Commit 49e9cebc authored by unknown's avatar unknown

Minor changes for WL 2056


ndb/src/common/portlib/NdbMem.c:
  Simplify insertion of print comments
ndb/src/common/util/new.cpp:
  malloc -> NdbMem_Allocate
ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp:
  Increase number of idle files to avoid allocation after starting
  ndbd
parent 1e5716ce
...@@ -31,10 +31,13 @@ void NdbMem_Destroy() ...@@ -31,10 +31,13 @@ void NdbMem_Destroy()
return; return;
} }
void* NdbMem_Allocate(size_t size) void* NdbMem_Allocate(size_t size)
{ {
void* mem_allocated;
assert(size > 0); assert(size > 0);
return (void*)malloc(size); mem_allocated= (void*)malloc(size);
return mem_allocated;
} }
void* NdbMem_AllocateAlign(size_t size, size_t alignment) void* NdbMem_AllocateAlign(size_t size, size_t alignment)
......
#include <ndb_global.h> #include <ndb_global.h>
#include <NdbMem.h>
extern "C" { extern "C" {
void (* ndb_new_handler)() = 0; void (* ndb_new_handler)() = 0;
...@@ -9,7 +10,7 @@ extern "C" { ...@@ -9,7 +10,7 @@ extern "C" {
void *operator new (size_t sz) void *operator new (size_t sz)
{ {
void * p = malloc (sz ? sz : 1); void * p = NdbMem_Allocate(sz ? sz : 1);
if(p) if(p)
return p; return p;
if(ndb_new_handler) if(ndb_new_handler)
...@@ -19,7 +20,7 @@ void *operator new (size_t sz) ...@@ -19,7 +20,7 @@ void *operator new (size_t sz)
void *operator new[] (size_t sz) void *operator new[] (size_t sz)
{ {
void * p = (void *) malloc (sz ? sz : 1); void * p = (void *) NdbMem_Allocate(sz ? sz : 1);
if(p) if(p)
return p; return p;
if(ndb_new_handler) if(ndb_new_handler)
...@@ -30,13 +31,13 @@ void *operator new[] (size_t sz) ...@@ -30,13 +31,13 @@ void *operator new[] (size_t sz)
void operator delete (void *ptr) void operator delete (void *ptr)
{ {
if (ptr) if (ptr)
free(ptr); NdbMem_Free(ptr);
} }
void operator delete[] (void *ptr) throw () void operator delete[] (void *ptr) throw ()
{ {
if (ptr) if (ptr)
free(ptr); NdbMem_Free(ptr);
} }
#endif // USE_MYSYS_NEW #endif // USE_MYSYS_NEW
...@@ -67,7 +67,7 @@ Ndbfs::Ndbfs(const Configuration & conf) : ...@@ -67,7 +67,7 @@ Ndbfs::Ndbfs(const Configuration & conf) :
//ndb_mgm_get_int_parameter(p, CFG_DB_MAX_OPEN_FILES, &m_maxFiles); //ndb_mgm_get_int_parameter(p, CFG_DB_MAX_OPEN_FILES, &m_maxFiles);
// Create idle AsyncFiles // Create idle AsyncFiles
Uint32 noIdleFiles = 16; Uint32 noIdleFiles = 27;
for (Uint32 i = 0; i < noIdleFiles; i++){ for (Uint32 i = 0; i < noIdleFiles; i++){
theIdleFiles.push_back(createAsyncFile()); theIdleFiles.push_back(createAsyncFile());
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment