template <class Config, void (*PostInitCallback)(void) = EmptyCallback>
class Allocator
Defined at line 51 of file ../../third_party/scudo/src/combined.h
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 204 of file ../../third_party/scudo/src/combined.h
void disableRingBuffer ()
Defined at line 211 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 220 of file ../../third_party/scudo/src/combined.h
const gwp_asan::AllocationMetadata * getGwpAsanAllocationMetadata ()
Defined at line 251 of file ../../third_party/scudo/src/combined.h
const gwp_asan::AllocatorState * getGwpAsanAllocatorState ()
Defined at line 255 of file ../../third_party/scudo/src/combined.h
void initThreadMaybe (bool MinimalInit)
Defined at line 260 of file ../../third_party/scudo/src/combined.h
void unmapTestOnly ()
Defined at line 264 of file ../../third_party/scudo/src/combined.h
TSDRegistryT * getTSDRegistry ()
Defined at line 276 of file ../../third_party/scudo/src/combined.h
QuarantineT * getQuarantine ()
Defined at line 277 of file ../../third_party/scudo/src/combined.h
void initAllocator (SizeClassAllocatorT * SizeClassAllocator)
The Cache must be provided zero-initialized.
Defined at line 280 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 289 of file ../../third_party/scudo/src/combined.h
void drainCache (TSD<ThisT> * TSD)
Defined at line 298 of file ../../third_party/scudo/src/combined.h
void drainCaches ()
Defined at line 307 of file ../../third_party/scudo/src/combined.h
void * getHeaderTaggedPointer (void * Ptr)
Defined at line 309 of file ../../third_party/scudo/src/combined.h
uptr addHeaderTag (uptr Ptr)
Defined at line 321 of file ../../third_party/scudo/src/combined.h
void * addHeaderTag (void * Ptr)
Defined at line 327 of file ../../third_party/scudo/src/combined.h
u32 collectStackTrace (StackDepot * Depot)
Defined at line 331 of file ../../third_party/scudo/src/combined.h
uptr computeOddEvenMaskForPointerMaybe (const Options &Options,uptrPtr,uptrClassId)
Defined at line 345 of file ../../third_party/scudo/src/combined.h
void * allocate (uptrSize,Chunk::OriginOrigin,uptrAlignment,boolZeroContents)
Defined at line 358 of file ../../third_party/scudo/src/combined.h
void deallocate (void * Ptr, Chunk::Origin Origin)
Defined at line 451 of file ../../third_party/scudo/src/combined.h
void deallocateSized (void *Ptr,Chunk::OriginOrigin,uptrDeleteSize)
Defined at line 455 of file ../../third_party/scudo/src/combined.h
void deallocateSizedAligned (void *Ptr,Chunk::OriginOrigin,uptrDeleteSize,uptrDeleteAlignment)
Defined at line 461 of file ../../third_party/scudo/src/combined.h
void deallocateAligned (void *Ptr,Chunk::OriginOrigin,uptrDeleteAlignment)
Defined at line 468 of file ../../third_party/scudo/src/combined.h
void checkSizeMatch (const void *Ptr,Chunk::UnpackedHeader *Header,uptrSize,uptrDeallocSize)
Defined at line 474 of file ../../third_party/scudo/src/combined.h
void checkTypeMatch (AllocatorActionAction,const void *Ptr,u8AllocOrigin,u8DeallocOrigin)
Defined at line 485 of file ../../third_party/scudo/src/combined.h
void deallocate (void *Ptr,u8DeallocOrigin,uptrDeleteSize,uptrDeleteAlignment)
Defined at line 509 of file ../../third_party/scudo/src/combined.h
void * reallocate (void *OldPtr,uptrNewSize,uptrAlignment)
Defined at line 570 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 676 of file ../../third_party/scudo/src/combined.h
void enable ()
Defined at line 690 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 709 of file ../../third_party/scudo/src/combined.h
void printStats ()
Defined at line 721 of file ../../third_party/scudo/src/combined.h
void printFragmentationInfo ()
Defined at line 727 of file ../../third_party/scudo/src/combined.h
void releaseToOS (ReleaseToOS ReleaseType)
Defined at line 734 of file ../../third_party/scudo/src/combined.h
void iterateOverChunks (uptrBase,uptrSize,iterate_callbackCallback,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 746 of file ../../third_party/scudo/src/combined.h
bool canReturnNull ()
Defined at line 797 of file ../../third_party/scudo/src/combined.h
bool setOption (Option O, sptr Value)
Defined at line 802 of file ../../third_party/scudo/src/combined.h
uptr getUsableSize (const void * Ptr, Chunk::UnpackedHeader * Header)
Defined at line 829 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 849 of file ../../third_party/scudo/src/combined.h
uptr getAllocSize (const void * Ptr)
Defined at line 875 of file ../../third_party/scudo/src/combined.h
void getStats (StatCounters S)
Defined at line 894 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 902 of file ../../third_party/scudo/src/combined.h
bool useMemoryTaggingTestOnly ()
Defined at line 919 of file ../../third_party/scudo/src/combined.h
void disableMemoryTagging ()
Defined at line 922 of file ../../third_party/scudo/src/combined.h
void setTrackAllocationStacks (bool Track)
Defined at line 936 of file ../../third_party/scudo/src/combined.h
void setFillContents (FillContentsMode FillContents)
Defined at line 950 of file ../../third_party/scudo/src/combined.h
void setAddLargeAllocationSlack (bool AddSlack)
Defined at line 955 of file ../../third_party/scudo/src/combined.h
const char * getStackDepotAddress ()
Defined at line 963 of file ../../third_party/scudo/src/combined.h
uptr getStackDepotSize ()
Defined at line 969 of file ../../third_party/scudo/src/combined.h
const char * getRegionInfoArrayAddress ()
Defined at line 975 of file ../../third_party/scudo/src/combined.h
uptr getRegionInfoArraySize ()
Defined at line 979 of file ../../third_party/scudo/src/combined.h
const char * getRingBufferAddress ()
Defined at line 983 of file ../../third_party/scudo/src/combined.h
uptr getRingBufferSize ()
Defined at line 988 of file ../../third_party/scudo/src/combined.h
void getErrorInfo (uptrFaultAddr,size_tMinDistance,size_tMaxDistance,scudo_error_report *Reports,size_t &ReportIndex)
Defined at line 996 of file ../../third_party/scudo/src/combined.h
void getRingBufferErrorInfo (uintptr_tFaultAddr,scudo_error_report *Reports,size_t &ReportIndex)
Defined at line 1063 of file ../../third_party/scudo/src/combined.h
void getErrorInfo (uintptr_t FaultAddr, struct scudo_error_info * ErrorInfo)
Defined at line 1152 of file ../../third_party/scudo/src/combined.h
void collectTraceMaybe (const StackDepot *Depot,uintptr_t (&)[64]Trace,u32Hash)
Defined at line 1176 of file ../../third_party/scudo/src/combined.h
uptr getBlockBeginTestOnly (const void * Ptr)
Defined at line 1185 of file ../../third_party/scudo/src/combined.h