template <typename Config>
class SizeClassAllocator64
Defined at line 51 of file ../../third_party/scudo/src/primary64.h
SizeClassAllocator64 is an allocator tuned for 64-bit address space.
It starts by reserving NumClasses * 2^RegionSizeLog bytes, equally divided in
Regions, specific to each size class. Note that the base of that mapping is
random (based to the platform specific map() capabilities). If
PrimaryEnableRandomOffset is set, each Region actually starts at a random
offset from its base.
Regions are mapped incrementally on demand to fulfill allocation requests,
those mappings being split into equally sized Blocks based on the size class
they belong to. The Blocks created are shuffled to prevent predictable
address patterns (the predictability increases with the size of the Blocks).
The 1st Region (for size class 0) holds the Batches. This is a
structure used to transfer arrays of available pointers from the class size
freelist to the thread specific freelist, and back.
The memory used by this allocator is never unmapped, but can be partially
released if the platform allows for it.
Public Members
AtomicOptions Options
static const uptr CompactPtrScale
static const uptr RegionSizeLog
static const uptr GroupSizeLog
static const uptr GroupScale
static const u16 MaxNumBlocksInBatch
Public Methods
uptr getSizeOfBatchClass ()
Defined at line 71 of file ../../third_party/scudo/src/primary64.h
uptr getSizeByClassId (uptr ClassId)
BachClass is used to store internal metadata so it needs to be at least as
large as the largest data structure.
Defined at line 82 of file ../../third_party/scudo/src/primary64.h
bool canAllocate (uptr Size)
Defined at line 88 of file ../../third_party/scudo/src/primary64.h
bool conditionVariableEnabled ()
Defined at line 89 of file ../../third_party/scudo/src/primary64.h
uptr getRegionInfoArraySize ()
Defined at line 92 of file ../../third_party/scudo/src/primary64.h
const char * getRegionInfoArrayAddress ()
Defined at line 128 of file ../../third_party/scudo/src/primary64.h
uptr getCompactPtrBaseByClassId (uptr ClassId)
Defined at line 132 of file ../../third_party/scudo/src/primary64.h
CompactPtrT compactPtr (uptr ClassId, uptr Ptr)
Defined at line 135 of file ../../third_party/scudo/src/primary64.h
void * decompactPtr (uptr ClassId, CompactPtrT CompactPtr)
Defined at line 139 of file ../../third_party/scudo/src/primary64.h
BlockInfo findNearestBlock (const char * RegionInfoData, uptr Ptr)
static
Defined at line 1409 of file ../../third_party/scudo/src/primary64.h
BlockInfo findNearestBlock (uptr Ptr)
Defined at line 1358 of file ../../third_party/scudo/src/primary64.h
void init (s32 ReleaseToOsInterval)
Defined at line 302 of file ../../third_party/scudo/src/primary64.h
void unmapTestOnly ()
Defined at line 409 of file ../../third_party/scudo/src/primary64.h
void verifyAllBlocksAreReleasedTestOnly ()
When all blocks are freed, it has to be the same size as `AllocatedUser`.
Defined at line 422 of file ../../third_party/scudo/src/primary64.h
u16 popBlocks (SizeClassAllocatorT *SizeClassAllocator,uptrClassId,CompactPtrT *ToArray,const u16MaxBlockCount)
Defined at line 471 of file ../../third_party/scudo/src/primary64.h
void pushBlocks (SizeClassAllocatorT *SizeClassAllocator,uptrClassId,CompactPtrT *Array,u32Size)
Push the array of free blocks to the designated batch group.
Defined at line 787 of file ../../third_party/scudo/src/primary64.h
void disable ()
Defined at line 1062 of file ../../third_party/scudo/src/primary64.h
void enable ()
Defined at line 1075 of file ../../third_party/scudo/src/primary64.h
template <typename F>
void iterateOverBlocks (F Callback)
Defined at line 1087 of file ../../third_party/scudo/src/primary64.h
void getStats (ScopedString * Str)
Defined at line 1107 of file ../../third_party/scudo/src/primary64.h
void getFragmentationInfo (ScopedString * Str)
Defined at line 1187 of file ../../third_party/scudo/src/primary64.h
void getMemoryGroupFragmentationInfo (ScopedString * Str)
Defined at line 1292 of file ../../third_party/scudo/src/primary64.h
bool setOption (Option O, sptr Value)
Defined at line 1306 of file ../../third_party/scudo/src/primary64.h
uptr tryReleaseToOS (uptr ClassId, ReleaseToOS ReleaseType)
These are used for returning unused pages. Note that it doesn't unmap the
pages, it only suggests that the physical pages can be released.
Defined at line 1319 of file ../../third_party/scudo/src/primary64.h
uptr releaseToOS (ReleaseToOS ReleaseType)
Defined at line 1334 of file ../../third_party/scudo/src/primary64.h