summaryrefslogtreecommitdiff
path: root/lib/theron_allocator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/theron_allocator.cpp')
-rw-r--r--lib/theron_allocator.cpp9
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();