template <typename Config>
class SizeClassAllocator32
Defined at line 45 of file ../../third_party/scudo/src/primary32.h
SizeClassAllocator32 is an allocator for 32 or 64-bit address space.
It maps Regions of 2^RegionSizeLog bytes aligned on a 2^RegionSizeLog bytes
boundary, and keeps a bytemap of the mappable address space to track the size
class they are associated with.
Mapped regions are split into equally sized Blocks according to the size
class they belong to, and the associated pointers are shuffled to prevent any
predictable address pattern (the predictability increases with the block
size).
Regions for size class 0 are special and used to hold Batches, which
allow to transfer arrays of pointers from the global size class freelist to
the thread specific freelist for said class, and back.
Memory used by this allocator is never unmapped but can be partially
reclaimed if the platform allows for it.
Public Members
AtomicOptions Options
static const uptr GroupSizeLog
static const u16 MaxNumBlocksInBatch
Public Methods
uptr getSizeOfBatchClass ()
Defined at line 64 of file ../../third_party/scudo/src/primary32.h
uptr getSizeByClassId (uptr ClassId)
Defined at line 72 of file ../../third_party/scudo/src/primary32.h
bool canAllocate (uptr Size)
Defined at line 78 of file ../../third_party/scudo/src/primary32.h
CompactPtrT compactPtr (uptr ClassId, uptr Ptr)
Defined at line 87 of file ../../third_party/scudo/src/primary32.h
void * decompactPtr (uptr ClassId, CompactPtrT CompactPtr)
Defined at line 90 of file ../../third_party/scudo/src/primary32.h
uptr compactPtrGroupBase (CompactPtrT CompactPtr)
Defined at line 93 of file ../../third_party/scudo/src/primary32.h
uptr decompactGroupBase (uptr CompactPtrGroupBase)
Defined at line 97 of file ../../third_party/scudo/src/primary32.h
bool isSmallBlock (uptr BlockSize)
Defined at line 100 of file ../../third_party/scudo/src/primary32.h
bool isLargeBlock (uptr BlockSize)
Defined at line 104 of file ../../third_party/scudo/src/primary32.h
void getMemoryGroupFragmentationInfo (ScopedString * Str)
Defined at line 123 of file ../../third_party/scudo/src/primary32.h
BlockInfo findNearestBlock (uptr Ptr)
Not supported in SizeClassAllocator32.
Defined at line 135 of file ../../third_party/scudo/src/primary32.h
void init (s32 ReleaseToOsInterval)
Defined at line 232 of file ../../third_party/scudo/src/primary32.h
void unmapTestOnly ()
Defined at line 262 of file ../../third_party/scudo/src/primary32.h
void verifyAllBlocksAreReleasedTestOnly ()
When all blocks are freed, it has to be the same size as `AllocatedUser`.
Defined at line 291 of file ../../third_party/scudo/src/primary32.h
u16 popBlocks (SizeClassAllocatorT *SizeClassAllocator,uptrClassId,CompactPtrT *ToArray,const u16MaxBlockCount)
Defined at line 336 of file ../../third_party/scudo/src/primary32.h
void pushBlocks (SizeClassAllocatorT *SizeClassAllocator,uptrClassId,CompactPtrT *Array,u32Size)
Push the array of free blocks to the designated batch group.
Defined at line 357 of file ../../third_party/scudo/src/primary32.h
void disable ()
Defined at line 394 of file ../../third_party/scudo/src/primary32.h
void enable (bool IsChild)
Defined at line 407 of file ../../third_party/scudo/src/primary32.h
template <typename F>
void iterateOverBlocks (F Callback)
Defined at line 420 of file ../../third_party/scudo/src/primary32.h
void getStats (ScopedString * Str)
Defined at line 451 of file ../../third_party/scudo/src/primary32.h
void getFragmentationInfo (ScopedString * Str)
Defined at line 476 of file ../../third_party/scudo/src/primary32.h
bool setOption (Option O, sptr Value)
Defined at line 489 of file ../../third_party/scudo/src/primary32.h
uptr tryReleaseToOS (uptr ClassId, ReleaseToOS ReleaseType)
Defined at line 502 of file ../../third_party/scudo/src/primary32.h
uptr releaseToOS (ReleaseToOS ReleaseType)
Defined at line 512 of file ../../third_party/scudo/src/primary32.h