template <class Config, void (*PostInitCallback)(void) = EmptyCallback>
class Allocator
Defined at line 51 of file ../../third_party/scudo/src/combined.h
Public Members
static const uptr MaxTraceSize
Public Methods
void callPostInitCallback ()
Defined at line 62 of file ../../third_party/scudo/src/combined.h
void init ()
Defined at line 145 of file ../../third_party/scudo/src/combined.h
void enableRingBuffer ()
Defined at line 198 of file ../../third_party/scudo/src/combined.h
void disableRingBuffer ()
Defined at line 205 of file ../../third_party/scudo/src/combined.h
void initGwpAsan ()
Initialize the embedded GWP-ASan instance. Requires the main allocator to
be functional, best called from PostInitCallback.
Defined at line 214 of file ../../third_party/scudo/src/combined.h
const gwp_asan::AllocationMetadata * getGwpAsanAllocationMetadata ()
Defined at line 245 of file ../../third_party/scudo/src/combined.h
const gwp_asan::AllocatorState * getGwpAsanAllocatorState ()
Defined at line 249 of file ../../third_party/scudo/src/combined.h
void initThreadMaybe (bool MinimalInit)
Defined at line 254 of file ../../third_party/scudo/src/combined.h
void unmapTestOnly ()
Defined at line 258 of file ../../third_party/scudo/src/combined.h
TSDRegistryT * getTSDRegistry ()
Defined at line 270 of file ../../third_party/scudo/src/combined.h
QuarantineT * getQuarantine ()
Defined at line 271 of file ../../third_party/scudo/src/combined.h
void initAllocator (SizeClassAllocatorT * SizeClassAllocator)
The Cache must be provided zero-initialized.
Defined at line 274 of file ../../third_party/scudo/src/combined.h
void commitBack (TSD<ThisT> * TSD)
Release the resources used by a TSD, which involves:
- draining the local quarantine cache to the global quarantine;
- releasing the cached pointers back to the Primary;
- unlinking the local stats from the global ones (destroying the cache does
the last two items).
Defined at line 283 of file ../../third_party/scudo/src/combined.h
void drainCache (TSD<ThisT> * TSD)
Defined at line 292 of file ../../third_party/scudo/src/combined.h
void drainCaches ()
Defined at line 301 of file ../../third_party/scudo/src/combined.h
void * getHeaderTaggedPointer (void * Ptr)
Defined at line 303 of file ../../third_party/scudo/src/combined.h
uptr addHeaderTag (uptr Ptr)
Defined at line 315 of file ../../third_party/scudo/src/combined.h
void * addHeaderTag (void * Ptr)
Defined at line 321 of file ../../third_party/scudo/src/combined.h
u32 collectStackTrace (StackDepot * Depot)
Defined at line 325 of file ../../third_party/scudo/src/combined.h
uptr computeOddEvenMaskForPointerMaybe (const Options & Options, uptr Ptr, uptr ClassId)
Defined at line 339 of file ../../third_party/scudo/src/combined.h
void * allocate (uptr Size, Chunk::Origin Origin, uptr Alignment, bool ZeroContents)
Defined at line 352 of file ../../third_party/scudo/src/combined.h
void deallocate (void * Ptr, Chunk::Origin Origin, uptr DeleteSize, uptr Alignment)
Defined at line 445 of file ../../third_party/scudo/src/combined.h
void * reallocate (void * OldPtr, uptr NewSize, uptr Alignment)
Defined at line 501 of file ../../third_party/scudo/src/combined.h
void disable ()
TODO(kostyak): disable() is currently best-effort. There are some small
windows of time when an allocation could still succeed after
this function finishes. We will revisit that later.
Defined at line 618 of file ../../third_party/scudo/src/combined.h
void enable ()
Defined at line 632 of file ../../third_party/scudo/src/combined.h
uptr getStats (char * Buffer, uptr Size)
The function returns the amount of bytes required to store the statistics,
which might be larger than the amount of bytes provided. Note that the
statistics buffer is not necessarily constant between calls to this
function. This can be called with a null buffer or zero size for buffer
sizing purposes.
Defined at line 651 of file ../../third_party/scudo/src/combined.h
void printStats ()
Defined at line 663 of file ../../third_party/scudo/src/combined.h
void printFragmentationInfo ()
Defined at line 669 of file ../../third_party/scudo/src/combined.h
void releaseToOS (ReleaseToOS ReleaseType)
Defined at line 676 of file ../../third_party/scudo/src/combined.h
void iterateOverChunks (uptr Base, uptr Size, iterate_callback Callback, void * Arg)
Iterate over all chunks and call a callback for all busy chunks located
within the provided memory range. Said callback must not use this allocator
or a deadlock can ensue. This fits Android's malloc_iterate() needs.
Defined at line 688 of file ../../third_party/scudo/src/combined.h
bool canReturnNull ()
Defined at line 739 of file ../../third_party/scudo/src/combined.h
bool setOption (Option O, sptr Value)
Defined at line 744 of file ../../third_party/scudo/src/combined.h
uptr getUsableSize (const void * Ptr, Chunk::UnpackedHeader * Header)
Defined at line 771 of file ../../third_party/scudo/src/combined.h
uptr getUsableSize (const void * Ptr)
Return the usable size for a given chunk. If MTE is enabled or if the
ExactUsableSize config parameter is true, we report the exact size of
the original allocation size. Otherwise, we will return the total
actual usable size.
Defined at line 791 of file ../../third_party/scudo/src/combined.h
uptr getAllocSize (const void * Ptr)
Defined at line 817 of file ../../third_party/scudo/src/combined.h
void getStats (StatCounters S)
Defined at line 836 of file ../../third_party/scudo/src/combined.h
bool isOwned (const void * Ptr)
Returns true if the pointer provided was allocated by the current
allocator instance, which is compliant with tcmalloc's ownership concept.
A corrupted chunk will not be reported as owned, which is WAI.
Defined at line 844 of file ../../third_party/scudo/src/combined.h
bool useMemoryTaggingTestOnly ()
Defined at line 861 of file ../../third_party/scudo/src/combined.h
void disableMemoryTagging ()
Defined at line 864 of file ../../third_party/scudo/src/combined.h
void setTrackAllocationStacks (bool Track)
Defined at line 878 of file ../../third_party/scudo/src/combined.h
void setFillContents (FillContentsMode FillContents)
Defined at line 892 of file ../../third_party/scudo/src/combined.h
void setAddLargeAllocationSlack (bool AddSlack)
Defined at line 897 of file ../../third_party/scudo/src/combined.h
const char * getStackDepotAddress ()
Defined at line 905 of file ../../third_party/scudo/src/combined.h
uptr getStackDepotSize ()
Defined at line 911 of file ../../third_party/scudo/src/combined.h
const char * getRegionInfoArrayAddress ()
Defined at line 917 of file ../../third_party/scudo/src/combined.h
uptr getRegionInfoArraySize ()
Defined at line 921 of file ../../third_party/scudo/src/combined.h
const char * getRingBufferAddress ()
Defined at line 925 of file ../../third_party/scudo/src/combined.h
uptr getRingBufferSize ()
Defined at line 930 of file ../../third_party/scudo/src/combined.h
void collectTraceMaybe (const StackDepot * Depot, uintptr_t (&)[64] Trace, u32 Hash)
Defined at line 940 of file ../../third_party/scudo/src/combined.h
void getErrorInfo (struct scudo_error_info * ErrorInfo, uintptr_t FaultAddr, const char * DepotPtr, size_t DepotSize, const char * RegionInfoPtr, const char * RingBufferPtr, size_t RingBufferSize, const char * Memory, const char * MemoryTags, uintptr_t MemoryAddr, size_t MemorySize)
Defined at line 949 of file ../../third_party/scudo/src/combined.h
uptr getBlockBeginTestOnly (const void * Ptr)
Defined at line 997 of file ../../third_party/scudo/src/combined.h