diff options
author | Josh Blum | 2012-10-11 23:40:02 -0700 |
---|---|---|
committer | Josh Blum | 2012-10-11 23:40:02 -0700 |
commit | ebd812fd4702cbe5c9ef487f6efc8a4e0eb165e9 (patch) | |
tree | 2bf06cadff53b91e764909c67aa40b2c92d0704d | |
parent | 4aa36c6aaaab4a5ae8eed1d81a46c1d09d32a258 (diff) | |
download | sandhi-ebd812fd4702cbe5c9ef487f6efc8a4e0eb165e9.tar.gz sandhi-ebd812fd4702cbe5c9ef487f6efc8a4e0eb165e9.tar.bz2 sandhi-ebd812fd4702cbe5c9ef487f6efc8a4e0eb165e9.zip |
some tweaks to the custom allocator
-rw-r--r-- | lib/theron_allocator.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/theron_allocator.cpp b/lib/theron_allocator.cpp index 23e0fd6..3158159 100644 --- a/lib/theron_allocator.cpp +++ b/lib/theron_allocator.cpp @@ -29,7 +29,7 @@ #include <Theron/AllocatorManager.h> #include <boost/circular_buffer.hpp> -#define MY_ALLOCATOR_CHUNK_SIZE 96 //Theron asks for a lot of 88-byte buffers +#define MY_ALLOCATOR_CHUNK_SIZE 256 #define MY_ALLOCATOR_POOL_SIZE (MY_ALLOCATOR_CHUNK_SIZE * (1 << 16)) static struct WorkerAllocator : Theron::IAllocator @@ -71,7 +71,7 @@ static struct WorkerAllocator : Theron::IAllocator else { //std::cout << "malloc size " << size << std::endl; - return std::malloc(size); + return new char[size]; } } @@ -86,7 +86,7 @@ static struct WorkerAllocator : Theron::IAllocator } else { - std::free(memory); + delete [] ((char *)memory); } } |