Lines Matching refs:tls
291 void *getFromLLOCache(TLSData *tls, size_t size, size_t alignment);
292 void putToLLOCache(TLSData *tls, void *object);
374 void privatizeOrphaned(TLSData *tls, unsigned index);
420 void initEmptyBlock(TLSData *tls, size_t size);
435 inline void markOwned(TLSData *tls) { in markOwned() argument
438 tlsPtr.store(tls, std::memory_order_relaxed); in markOwned()
618 TLSData* tls = (TLSData*) memPool->bootStrapBlocks.allocate(memPool, sizeof(TLSData)); in createTLS() local
619 if ( !tls ) in createTLS()
621 new(tls) TLSData(memPool, backend); in createTLS()
625 tls->bin[i].verifyInitState(); in createTLS()
627 setThreadMallocTLS(tls); in createTLS()
628 memPool->extMemPool.allLocalCaches.registerThread(tls); in createTLS()
629 return tls; in createTLS()
661 void AllLocalCaches::registerThread(TLSRemote *tls) in registerThread() argument
663 tls->prev = nullptr; in registerThread()
665 MALLOC_ASSERT(head!=tls, ASSERT_TEXT); in registerThread()
666 tls->next = head; in registerThread()
668 head->prev = tls; in registerThread()
669 head = tls; in registerThread()
673 void AllLocalCaches::unregisterThread(TLSRemote *tls) in unregisterThread() argument
677 if (head == tls) in unregisterThread()
678 head = tls->next; in unregisterThread()
679 if (tls->next) in unregisterThread()
680 tls->next->prev = tls->prev; in unregisterThread()
681 if (tls->prev) in unregisterThread()
682 tls->prev->next = tls->next; in unregisterThread()
683 MALLOC_ASSERT(!tls->next || tls->next->next!=tls->next, ASSERT_TEXT); in unregisterThread()
992 TLSData* tls = extMemPool.tlsPointerKey.getThreadMallocTLS(); in getTLS() local
993 if (create && !tls) in getTLS()
994 tls = extMemPool.tlsPointerKey.createTLS(this, &extMemPool.backend); in getTLS()
995 return tls; in getTLS()
1009 TLSData* tls = getTLS(/*create=*/false); in getEmptyBlock() local
1011 FreeBlockPool::ResOfGet resOfGet = tls? in getEmptyBlock()
1012 tls->freeSlabBlocks.getBlock() : FreeBlockPool::ResOfGet(nullptr, false); in getEmptyBlock()
1045 b->tlsPtr.store(tls, std::memory_order_relaxed); in getEmptyBlock()
1049 MALLOC_ASSERT(tls, ASSERT_TEXT); in getEmptyBlock()
1050 tls->freeSlabBlocks.returnBlock(b); in getEmptyBlock()
1055 result->initEmptyBlock(tls, size); in getEmptyBlock()
1438 TLSData* tls = getThreadMallocTLS(); in freePublicObject() local
1439 MALLOC_ASSERT( theBin==tls->bin+index, ASSERT_TEXT ); in freePublicObject()
1491 void Block::privatizeOrphaned(TLSData *tls, unsigned index) in privatizeOrphaned() argument
1493 Bin* bin = tls->bin + index; in privatizeOrphaned()
1499 markOwned(tls); in privatizeOrphaned()
1576 void Block::initEmptyBlock(TLSData *tls, size_t size) in initEmptyBlock() argument
1585 markOwned(tls); in initEmptyBlock()
1591 nextPrivatizable.store( tls? (Block*)(tls->bin + index) : nullptr, std::memory_order_relaxed); in initEmptyBlock()
1596 Block *OrphanedBlocks::get(TLSData *tls, unsigned int size) in get() argument
1603 block->privatizeOrphaned(tls, index); in get()
2281 void *MemoryPool::getFromLLOCache(TLSData* tls, size_t size, size_t alignment) in getFromLLOCache() argument
2291 if (tls) { in getFromLLOCache()
2292 tls->markUsed(); in getFromLLOCache()
2293 lmb = tls->lloc.get(allocationSize); in getFromLLOCache()
2309 if (ptrDelta && tls) { // !tls is cold path in getFromLLOCache()
2316 unsigned myCacheIdx = ++tls->currCacheIdx; in getFromLLOCache()
2341 void MemoryPool::putToLLOCache(TLSData *tls, void *object) in putToLLOCache() argument
2347 if (tls) { in putToLLOCache()
2348 tls->markUsed(); in putToLLOCache()
2349 if (tls->lloc.put(header->memoryBlock, &extMemPool)) in putToLLOCache()
2389 TLSData *tls = memPool->getTLS(/*create=*/true); in allocateAligned()
2392 memPool->getFromLLOCache(tls, size, largeObjectAlignment>alignment? in allocateAligned()
2559 TLSData *tls = memPool->getTLS(/*create=*/true); in internalPoolMalloc() local
2563 return memPool->getFromLLOCache(tls, size, largeObjectAlignment); in internalPoolMalloc()
2565 if (!tls) return nullptr; in internalPoolMalloc()
2567 tls->markUsed(); in internalPoolMalloc()
2572 bin = tls->getAllocationBin(size); in internalPoolMalloc()
2599 mallocBlock = memPool->extMemPool.orphanedBlocks.get(tls, size); in internalPoolMalloc()
2605 mallocBlock = memPool->extMemPool.orphanedBlocks.get(tls, size); in internalPoolMalloc()
2853 void doThreadShutdownNotification(TLSData* tls, bool main_thread) in doThreadShutdownNotification() argument
2859 if (tls) { in doThreadShutdownNotification()
2861 tls->getMemPool()->onThreadShutdown(tls); in doThreadShutdownNotification()
2866 suppress_unused_warning(tls); // not used on Windows in doThreadShutdownNotification()
2972 TLSData *tls = defaultMemPool->getTLS(/*create=*/false); in __TBB_malloc_safer_free() local
2974 defaultMemPool->putToLLOCache(tls, object); in __TBB_malloc_safer_free()
3297 if (TLSData *tls = defaultMemPool->getTLS(/*create=*/false)) in scalable_allocation_command() local
3298 released = tls->externalCleanup(/*cleanOnlyUnused*/false, /*cleanBins=*/true); in scalable_allocation_command()