diff options
author | Josh Blum | 2012-10-04 21:19:17 -0700 |
---|---|---|
committer | Josh Blum | 2012-10-04 21:19:17 -0700 |
commit | 9672caa0c1f474eb06546737c61cae4ba7a6bb64 (patch) | |
tree | 43bff5e4b0ba9356a0af96ec604b0a8a17e1b6e2 | |
parent | 709f8e97cc642e446d357612a6d6512d5a4c5330 (diff) | |
download | sandhi-9672caa0c1f474eb06546737c61cae4ba7a6bb64.tar.gz sandhi-9672caa0c1f474eb06546737c61cae4ba7a6bb64.tar.bz2 sandhi-9672caa0c1f474eb06546737c61cae4ba7a6bb64.zip |
make MY_ALLOCATOR_POOL_SIZE much larger, fail print debug
-rw-r--r-- | lib/theron_allocator.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/theron_allocator.cpp b/lib/theron_allocator.cpp index 01d21ef..23e0fd6 100644 --- a/lib/theron_allocator.cpp +++ b/lib/theron_allocator.cpp @@ -30,7 +30,7 @@ #include <boost/circular_buffer.hpp> #define MY_ALLOCATOR_CHUNK_SIZE 96 //Theron asks for a lot of 88-byte buffers -#define MY_ALLOCATOR_POOL_SIZE (MY_ALLOCATOR_CHUNK_SIZE * 4096) +#define MY_ALLOCATOR_POOL_SIZE (MY_ALLOCATOR_CHUNK_SIZE * (1 << 16)) static struct WorkerAllocator : Theron::IAllocator { @@ -57,7 +57,12 @@ static struct WorkerAllocator : Theron::IAllocator if (size <= MY_ALLOCATOR_CHUNK_SIZE) { mSpinLock.Lock(); - ASSERT(not queue.empty()); + if (queue.empty()) + { + mSpinLock.Unlock(); + std::cout << "~" << std::flush; + return std::malloc(size); + } void *memory = queue.front(); queue.pop_front(); mSpinLock.Unlock(); |