Lines Matching refs:size

103     void *allocate(MemoryPool *memPool, size_t size);
287 Block *getEmptyBlock(size_t size);
291 void *getFromLLOCache(TLSData *tls, size_t size, size_t alignment);
420 void initEmptyBlock(TLSData *tls, size_t size);
475 void verifyTLSBin(size_t size) const;
541 int size; member in rml::internal::FreeBlockPool
573 LargeMemoryBlock *get(size_t size);
598 Bin* getAllocationBin(size_t size);
736 static void *internalMalloc(size_t size);
738 static void *internalPoolMalloc(MemoryPool* mPool, size_t size);
739 static bool internalPoolFree(MemoryPool *mPool, void *object, size_t size);
806 unsigned int getSmallObjectIndex(unsigned int size) in getSmallObjectIndex() argument
808 unsigned int result = (size-1)>>3; in getSmallObjectIndex()
822 static unsigned int getIndexOrObjectSize (unsigned int size) in getIndexOrObjectSize() argument
824 if (size <= maxSmallObjectSize) { // selection from 8/16/24/32/40/48/56/64 in getIndexOrObjectSize()
825 unsigned int index = getSmallObjectIndex( size ); in getIndexOrObjectSize()
829 …else if (size <= maxSegregatedObjectSize ) { // 80/96/112/128 / 160/192/224/256 / 320/384/448/512 … in getIndexOrObjectSize()
830 unsigned int order = highestBitPos(size-1); // which group of bin sizes? in getIndexOrObjectSize()
833 return minSegregatedObjectIndex - (4*6) - 4 + (4*order) + ((size-1)>>(order-2)); in getIndexOrObjectSize()
837 return alignUp(size,alignment); in getIndexOrObjectSize()
841 if( size <= fittingSize3 ) { in getIndexOrObjectSize()
842 if( size <= fittingSize2 ) { in getIndexOrObjectSize()
843 if( size <= fittingSize1 ) in getIndexOrObjectSize()
850 if( size <= fittingSize5 ) { in getIndexOrObjectSize()
851 if( size <= fittingSize4 ) in getIndexOrObjectSize()
863 static unsigned int getIndex (unsigned int size) in getIndex() argument
865 return getIndexOrObjectSize</*indexRequest=*/true>(size); in getIndex()
868 static unsigned int getObjectSize (unsigned int size) in getObjectSize() argument
870 return getIndexOrObjectSize</*indexRequest=*/false>(size); in getObjectSize()
874 void *BootStrapBlocks::allocate(MemoryPool *memPool, size_t size) in allocate() argument
878 MALLOC_ASSERT( size == sizeof(TLSData), ASSERT_TEXT ); in allocate()
888 bootStrapBlock = memPool->getEmptyBlock(size); in allocate()
901 memset (result, 0, size); in allocate()
1001 inline Bin* TLSData::getAllocationBin(size_t size) in getAllocationBin() argument
1003 return bin + getIndex(size); in getAllocationBin()
1007 Block *MemoryPool::getEmptyBlock(size_t size) in getEmptyBlock() argument
1055 result->initEmptyBlock(tls, size); in getEmptyBlock()
1171 void Bin::verifyTLSBin (size_t size) const in verifyTLSBin()
1174 uint32_t objSize = getObjectSize(size); in verifyTLSBin()
1212 unsigned int size = block->objectSize; in pushTLSBin() local
1220 verifyTLSBin(size); in pushTLSBin()
1232 verifyTLSBin(size); in pushTLSBin()
1240 unsigned int size = block->objectSize; in outofTLSBin() local
1246 verifyTLSBin(size); in outofTLSBin()
1263 verifyTLSBin(size); in outofTLSBin()
1576 void Block::initEmptyBlock(TLSData *tls, size_t size) in initEmptyBlock() argument
1580 unsigned int index = getIndex(size); in initEmptyBlock()
1581 unsigned int objSz = getObjectSize(size); in initEmptyBlock()
1596 Block *OrphanedBlocks::get(TLSData *tls, unsigned int size) in get() argument
1599 unsigned int index = getIndex(size); in get()
1654 size--; in getBlock()
1666 MALLOC_ASSERT( size <= POOL_HIGH_MARK, ASSERT_TEXT ); in returnBlock()
1670 size = 0; // head was stolen by externalClean, correct size accordingly in returnBlock()
1671 } else if (size == POOL_HIGH_MARK) { in returnBlock()
1680 size = POOL_LOW_MARK-1; in returnBlock()
1689 size++; in returnBlock()
1842 static FreeObject *allocate(size_t size);
1868 FreeObject *StartupBlock::allocate(size_t size) in allocate() argument
1875 size = alignUp(size, sizeof(size_t)); in allocate()
1877 size_t reqSize = size + sizeof(size_t); in allocate()
1898 *((size_t*)result) = size; in allocate()
2169 size_t size = in findObjectSize() local
2171 MALLOC_ASSERT(size>0 && size<minLargeObjectSize, ASSERT_TEXT); in findObjectSize()
2172 return size; in findObjectSize()
2198 const size_t size = object->unalignedSize; in put() local
2200 if (size > MAX_TOTAL_SIZE) in put()
2215 totalSize += size; in put()
2236 LargeMemoryBlock *LocalLOCImpl<LOW_MARK, HIGH_MARK>::get(size_t size) in get() argument
2240 if (size > MAX_TOTAL_SIZE) in get()
2251 if (curr->unalignedSize == size) { in get()
2261 totalSize -= size; in get()
2281 void *MemoryPool::getFromLLOCache(TLSData* tls, size_t size, size_t alignment) in getFromLLOCache() argument
2286 size_t allocationSize = LargeObjectCache::alignToBin(size+headersSize+alignment); in getFromLLOCache()
2287 if (allocationSize < size) // allocationSize is wrapped around after alignToBin in getFromLLOCache()
2305 alignDown((uintptr_t)lmb+lmb->unalignedSize - size, alignment); in getFromLLOCache()
2325 (uintptr_t)alignedArea+size, "Object doesn't fit the block."); in getFromLLOCache()
2331 lmb->objectSize = size; in getFromLLOCache()
2367 static void *allocateAligned(MemoryPool *memPool, size_t size, size_t alignment) in allocateAligned() argument
2376 if (size<=maxSegregatedObjectSize && alignment<=maxSegregatedObjectSize) in allocateAligned()
2377 result = internalPoolMalloc(memPool, alignUp(size? size: sizeof(size_t), alignment)); in allocateAligned()
2378 else if (size<minLargeObjectSize) { in allocateAligned()
2380 result = internalPoolMalloc(memPool, size); in allocateAligned()
2381 else if (size+alignment < minLargeObjectSize) { in allocateAligned()
2382 void *unaligned = internalPoolMalloc(memPool, size+alignment); in allocateAligned()
2392 memPool->getFromLLOCache(tls, size, largeObjectAlignment>alignment? in allocateAligned()
2550 static void *internalPoolMalloc(MemoryPool* memPool, size_t size) in internalPoolMalloc() argument
2557 if (!size) size = sizeof(size_t); in internalPoolMalloc()
2562 if (size >= minLargeObjectSize) in internalPoolMalloc()
2563 return memPool->getFromLLOCache(tls, size, largeObjectAlignment); in internalPoolMalloc()
2572 bin = tls->getAllocationBin(size); in internalPoolMalloc()
2593 return internalPoolMalloc(memPool, size); in internalPoolMalloc()
2599 mallocBlock = memPool->extMemPool.orphanedBlocks.get(tls, size); in internalPoolMalloc()
2605 mallocBlock = memPool->extMemPool.orphanedBlocks.get(tls, size); in internalPoolMalloc()
2611 mallocBlock = memPool->getEmptyBlock(size); in internalPoolMalloc()
2619 return internalPoolMalloc(memPool, size); in internalPoolMalloc()
2632 static bool internalPoolFree(MemoryPool *memPool, void *object, size_t size) in internalPoolFree() argument
2642 if (size >= minLargeObjectSize || isLargeObject<ourMem>(object)) in internalPoolFree()
2649 static void *internalMalloc(size_t size) in internalMalloc() argument
2651 if (!size) size = sizeof(size_t); in internalMalloc()
2655 return size<minLargeObjectSize? StartupBlock::allocate(size) : in internalMalloc()
2657 (FreeObject*)defaultMemPool->getFromLLOCache(nullptr, size, slabSize); in internalMalloc()
2663 return internalPoolMalloc(defaultMemPool, size); in internalMalloc()
2753 void *pool_malloc(rml::MemoryPool* mPool, size_t size) in pool_malloc() argument
2755 return internalPoolMalloc((rml::internal::MemoryPool*)mPool, size); in pool_malloc()
2758 void *pool_realloc(rml::MemoryPool* mPool, void *object, size_t size) in pool_realloc() argument
2761 return internalPoolMalloc((rml::internal::MemoryPool*)mPool, size); in pool_realloc()
2762 if (!size) { in pool_realloc()
2766 return reallocAligned((rml::internal::MemoryPool*)mPool, object, size, 0); in pool_realloc()
2769 void *pool_aligned_malloc(rml::MemoryPool* mPool, size_t size, size_t alignment) in pool_aligned_malloc() argument
2771 if (!isPowerOfTwo(alignment) || 0==size) in pool_aligned_malloc()
2774 return allocateAligned((rml::internal::MemoryPool*)mPool, size, alignment); in pool_aligned_malloc()
2777 void *pool_aligned_realloc(rml::MemoryPool* memPool, void *ptr, size_t size, size_t alignment) in pool_aligned_realloc() argument
2785 tmp = allocateAligned(mPool, size, alignment); in pool_aligned_realloc()
2786 else if (!size) { in pool_aligned_realloc()
2790 tmp = reallocAligned(mPool, ptr, size, alignment); in pool_aligned_realloc()
2939 extern "C" void * scalable_malloc(size_t size) in scalable_malloc() argument
2941 void *ptr = internalMalloc(size); in scalable_malloc()
2952 extern "C" void __TBB_malloc_free_definite_size(void *object, size_t size) in __TBB_malloc_free_definite_size() argument
2954 internalPoolFree(defaultMemPool, object, size); in __TBB_malloc_free_definite_size()
2997 extern "C" void* scalable_realloc(void* ptr, size_t size) in scalable_realloc() argument
3002 tmp = internalMalloc(size); in scalable_realloc()
3003 else if (!size) { in scalable_realloc()
3007 tmp = reallocAligned(defaultMemPool, ptr, size, 0); in scalable_realloc()
3072 extern "C" void * scalable_calloc(size_t nobj, size_t size) in scalable_calloc() argument
3076 const size_t arraySize = nobj * size; in scalable_calloc()
3079 if (nobj>=mult_not_overflow || size>=mult_not_overflow) // 1) heuristic check in scalable_calloc()
3080 if (nobj && arraySize / nobj != size) { // 2) exact check in scalable_calloc()
3096 extern "C" int scalable_posix_memalign(void **memptr, size_t alignment, size_t size) in scalable_posix_memalign() argument
3100 void *result = allocateAligned(defaultMemPool, size, alignment); in scalable_posix_memalign()
3107 extern "C" void * scalable_aligned_malloc(size_t size, size_t alignment) in scalable_aligned_malloc() argument
3109 if (!isPowerOfTwo(alignment) || 0==size) { in scalable_aligned_malloc()
3113 void *tmp = allocateAligned(defaultMemPool, size, alignment); in scalable_aligned_malloc()
3118 extern "C" void * scalable_aligned_realloc(void *ptr, size_t size, size_t alignment) in scalable_aligned_realloc() argument
3127 tmp = allocateAligned(defaultMemPool, size, alignment); in scalable_aligned_realloc()
3128 else if (!size) { in scalable_aligned_realloc()
3132 tmp = reallocAligned(defaultMemPool, ptr, size, alignment); in scalable_aligned_realloc()
3138 extern "C" TBBMALLOC_EXPORT void * __TBB_malloc_safer_aligned_realloc(void *ptr, size_t size, size_… in __TBB_malloc_safer_aligned_realloc() argument
3148 tmp = allocateAligned(defaultMemPool, size, alignment); in __TBB_malloc_safer_aligned_realloc()
3150 if (!size) { in __TBB_malloc_safer_aligned_realloc()
3154 tmp = reallocAligned(defaultMemPool, ptr, size, alignment); in __TBB_malloc_safer_aligned_realloc()
3160 if (size) { in __TBB_malloc_safer_aligned_realloc()
3166 tmp = allocateAligned(defaultMemPool, size, alignment); in __TBB_malloc_safer_aligned_realloc()
3168 memcpy(tmp, ptr, size<oldSize? size : oldSize); in __TBB_malloc_safer_aligned_realloc()