--- file_not_specified_in_diff +++ file_not_specified_in_diff @@ -, +, @@ --- trunk/c++/src/app/netcache/nc_memory.cpp 2011/12/16 17:42:54 52330 +++ trunk/c++/src/app/netcache/nc_memory.cpp 2012/02/27 14:38:30 53136 @@ -360,7 +360,7 @@ m_ObjLock.Lock(); ++m_SysFrees; m_SystemMem -= alloced_size; - m_LostMem -= alloced_size -= asked_size; + m_LostMem -= alloced_size - asked_size; m_ObjLock.Unlock(); } @@ -2539,7 +2539,7 @@ bool CNCMemManager::InitializeApp(void) { - try { + /*try { CSQLITE_Global::SetCustomMallocFuncs(&s_NCMallocMethods); } catch (CSQLITE_Exception& ex) { @@ -2547,13 +2547,15 @@ return false; } - return CNCMMCentral::RunLateInit(); + return CNCMMCentral::RunLateInit();*/ + g_InitNCThreadIndexes(); + return true; } void CNCMemManager::FinalizeApp(void) { - CNCMMCentral::PrepareToStop(); + //CNCMMCentral::PrepareToStop(); } void @@ -2571,28 +2573,29 @@ void CNCMemManager::PrintStats(CPrintTextProxy& proxy) { - CNCMMStats stats_sum; + /*CNCMMStats stats_sum; CNCMMStats::CollectAllStats(&stats_sum); - stats_sum.Print(proxy); + stats_sum.Print(proxy);*/ } size_t CNCMemManager::GetMemoryLimit(void) { - return CNCMMCentral::GetMemLimit(); + return 0;//CNCMMCentral::GetMemLimit(); } size_t CNCMemManager::GetMemoryUsed(void) { - CNCMMStats stat; + /*CNCMMStats stat; CNCMMStats::CollectAllStats(&stat); - return stat.GetSystemMem(); + return stat.GetSystemMem();*/ + return 0; } END_NCBI_SCOPE - +/* void* operator new (size_t size) #ifndef NCBI_COMPILER_MSVC @@ -2626,13 +2629,13 @@ { NCBI_NS_NCBI::CNCMMCentral::DeallocMemory(ptr); } - +*/ #ifdef __GLIBC__ // glibc has special method of overriding C library allocation functions. #include - +/* void* s_NCMallocHook(size_t size, const void* caller) { return NCBI_NS_NCBI::CNCMMCentral::AllocMemory(size); @@ -2656,7 +2659,7 @@ } void (*__malloc_initialize_hook) (void) = s_NCInitMallocHook; - +*/ #elif !defined(NCBI_OS_MSWIN) // Changing of C library allocation functions on Windows is very tricky (if // possible at all) and NetCache will never run in production on Windows. So