line |
true |
false |
branch |
87
|
0 |
0 |
if (!first_free) grow(); |
119
|
0 |
0 |
if ((size & (factor-1)) == 0) return size; |
129
|
0 |
0 |
PANDA_TLS_MEMBER_PTR (StaticMemoryPool, MemoryPool*, instance, new MemoryPool(BLOCKSIZE)); |
|
0 |
0 |
PANDA_TLS_MEMBER_PTR (StaticMemoryPool, MemoryPool*, instance, new MemoryPool(BLOCKSIZE)); |
|
0 |
0 |
PANDA_TLS_MEMBER_PTR (StaticMemoryPool, MemoryPool*, instance, new MemoryPool(BLOCKSIZE)); |
|
0 |
0 |
PANDA_TLS_MEMBER_PTR (StaticMemoryPool, MemoryPool*, instance, new MemoryPool(BLOCKSIZE)); |
147
|
0 |
0 |
PANDA_TLS_MEMBER_PTR(DynamicMemoryPool, DynamicMemoryPool*, instance, new DynamicMemoryPool()); |
|
0 |
0 |
PANDA_TLS_MEMBER_PTR(DynamicMemoryPool, DynamicMemoryPool*, instance, new DynamicMemoryPool()); |
152
|
0 |
0 |
if (size == 0) return NULL; |
154
|
0 |
0 |
if (size <= 1024) { |
156
|
0 |
0 |
if (!pool) pool = small_pools[(size-1)>>2] = new MemoryPool((((size-1)>>2) + 1)<<2); |
|
0 |
0 |
if (!pool) pool = small_pools[(size-1)>>2] = new MemoryPool((((size-1)>>2) + 1)<<2); |
158
|
0 |
0 |
else if (size <= 16384) { |
160
|
0 |
0 |
if (!pool) pool = medium_pools[(size-1)>>6] = new MemoryPool((((size-1)>>6) + 1)<<6); |
|
0 |
0 |
if (!pool) pool = medium_pools[(size-1)>>6] = new MemoryPool((((size-1)>>6) + 1)<<6); |
162
|
0 |
0 |
else if (size <= 262144) { |
164
|
0 |
0 |
if (!pool) pool = big_pools[(size-1)>>10] = new MemoryPool((((size-1)>>10) + 1)<<10); |
|
0 |
0 |
if (!pool) pool = big_pools[(size-1)>>10] = new MemoryPool((((size-1)>>10) + 1)<<10); |
166
|
0 |
0 |
else throw std::invalid_argument("ObjectAllocator: object size cannot exceed 256k"); |
172
|
0 |
0 |
if (ptr == NULL || size == 0) return; |
|
0 |
0 |
if (ptr == NULL || size == 0) return; |
174
|
0 |
0 |
if (size <= 1024) pool = small_pools[(size-1)>>2]; |
175
|
0 |
0 |
else if (size <= 16384) pool = medium_pools[(size-1)>>6]; |
176
|
0 |
0 |
else if (size <= 262144) pool = big_pools[(size-1)>>10]; |
177
|
0 |
0 |
else throw std::invalid_argument("ObjectAllocator: object size cannot exceed 256k"); |
197
|
0 |
0 |
if (size == sizeof(TARGET)) return StaticMemoryPool::allocate(); |
|
0 |
0 |
if (size == sizeof(TARGET)) return StaticMemoryPool::allocate(); |
202
|
0 |
0 |
if (size == sizeof(TARGET)) StaticMemoryPool::deallocate(p); |
|
0 |
0 |
if (size == sizeof(TARGET)) StaticMemoryPool::deallocate(p); |