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 126 of file ../../third_party/scudo/src/primary64.h
uptr getCompactPtrBaseByClassId (uptr ClassId)
Defined at line 130 of file ../../third_party/scudo/src/primary64.h
CompactPtrT compactPtr (uptr ClassId, uptr Ptr)
Defined at line 133 of file ../../third_party/scudo/src/primary64.h
void * decompactPtr (uptr ClassId, CompactPtrT CompactPtr)
Defined at line 137 of file ../../third_party/scudo/src/primary64.h
BlockInfo findNearestBlock (const char * RegionInfoData, uptr Ptr)
static
Defined at line 1338 of file ../../third_party/scudo/src/primary64.h
void init (s32 ReleaseToOsInterval)
Defined at line 300 of file ../../third_party/scudo/src/primary64.h
void unmapTestOnly ()
Defined at line 407 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 420 of file ../../third_party/scudo/src/primary64.h
u16 popBlocks (SizeClassAllocatorT * SizeClassAllocator, uptr ClassId, CompactPtrT * ToArray, const u16 MaxBlockCount)
Defined at line 469 of file ../../third_party/scudo/src/primary64.h
void pushBlocks (SizeClassAllocatorT * SizeClassAllocator, uptr ClassId, CompactPtrT * Array, u32 Size)
Push the array of free blocks to the designated batch group.
Defined at line 785 of file ../../third_party/scudo/src/primary64.h
void disable ()
Defined at line 1057 of file ../../third_party/scudo/src/primary64.h
void enable ()
Defined at line 1070 of file ../../third_party/scudo/src/primary64.h
template <typename F>
void iterateOverBlocks (F Callback)
Defined at line 1082 of file ../../third_party/scudo/src/primary64.h
void getStats (ScopedString * Str)
Defined at line 1102 of file ../../third_party/scudo/src/primary64.h
void getFragmentationInfo (ScopedString * Str)
Defined at line 1176 of file ../../third_party/scudo/src/primary64.h
void getMemoryGroupFragmentationInfo (ScopedString * Str)
Defined at line 1281 of file ../../third_party/scudo/src/primary64.h
bool setOption (Option O, sptr Value)
Defined at line 1295 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 1308 of file ../../third_party/scudo/src/primary64.h
uptr releaseToOS (ReleaseToOS ReleaseType)
Defined at line 1323 of file ../../third_party/scudo/src/primary64.h