template <typename Config>
class FixedSizeClassMap
Defined at line 61 of file ../../third_party/scudo/src/size_class_map.h
SizeClassMap maps allocation sizes into size classes and back, in an
efficient table-free manner.
Class 0 is a special class that doesn't abide by the same rules as other
classes. The allocator uses it to hold batches.
The other sizes are controlled by the template parameters:
- MinSizeLog: defines the first class as 2^MinSizeLog bytes.
- MaxSizeLog: defines the last class as 2^MaxSizeLog bytes.
- MidSizeLog: classes increase with step 2^MinSizeLog from 2^MinSizeLog to
2^MidSizeLog bytes.
- NumBits: the number of non-zero bits in sizes after 2^MidSizeLog.
eg. with NumBits==3 all size classes after 2^MidSizeLog look like
0b1xx0..0 (where x is either 0 or 1).
This class also gives a hint to a thread-caching allocator about the amount
of chunks that can be cached per-thread:
- MaxNumCachedHint is a hint for the max number of chunks cached per class.
- 2^MaxBytesCachedLog is the max number of bytes cached per class.
Public Members
static const u16 MaxNumCachedHint
static const uptr MaxSize
static const uptr NumClasses
static const uptr LargestClassId
static const uptr BatchClassId
Public Methods
uptr getSizeByClassId (uptr ClassId)
Defined at line 80 of file ../../third_party/scudo/src/size_class_map.h
u8 getSizeLSBByClassId (uptr ClassId)
Defined at line 89 of file ../../third_party/scudo/src/size_class_map.h
bool usesCompressedLSBFormat ()
Defined at line 93 of file ../../third_party/scudo/src/size_class_map.h
uptr getClassIdBySize (uptr Size)
Defined at line 95 of file ../../third_party/scudo/src/size_class_map.h
u16 getMaxCachedHint (uptr Size)
Defined at line 105 of file ../../third_party/scudo/src/size_class_map.h