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 200 of file ../../third_party/scudo/src/combined.h
void disableRingBuffer ()
Defined at line 207 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 216 of file ../../third_party/scudo/src/combined.h
const gwp_asan::AllocationMetadata * getGwpAsanAllocationMetadata ()
Defined at line 247 of file ../../third_party/scudo/src/combined.h
const gwp_asan::AllocatorState * getGwpAsanAllocatorState ()
Defined at line 251 of file ../../third_party/scudo/src/combined.h
void initThreadMaybe (bool MinimalInit)
Defined at line 256 of file ../../third_party/scudo/src/combined.h
void unmapTestOnly ()
Defined at line 260 of file ../../third_party/scudo/src/combined.h
TSDRegistryT * getTSDRegistry ()
Defined at line 272 of file ../../third_party/scudo/src/combined.h
QuarantineT * getQuarantine ()
Defined at line 273 of file ../../third_party/scudo/src/combined.h
void initAllocator (SizeClassAllocatorT * SizeClassAllocator)
The Cache must be provided zero-initialized.
Defined at line 276 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 285 of file ../../third_party/scudo/src/combined.h
void drainCache (TSD<ThisT> * TSD)
Defined at line 294 of file ../../third_party/scudo/src/combined.h
void drainCaches ()
Defined at line 303 of file ../../third_party/scudo/src/combined.h
void * getHeaderTaggedPointer (void * Ptr)
Defined at line 305 of file ../../third_party/scudo/src/combined.h
uptr addHeaderTag (uptr Ptr)
Defined at line 317 of file ../../third_party/scudo/src/combined.h
void * addHeaderTag (void * Ptr)
Defined at line 323 of file ../../third_party/scudo/src/combined.h
u32 collectStackTrace (StackDepot * Depot)
Defined at line 327 of file ../../third_party/scudo/src/combined.h
uptr computeOddEvenMaskForPointerMaybe (const Options &Options,uptrPtr,uptrClassId)
Defined at line 341 of file ../../third_party/scudo/src/combined.h
void * allocate (uptrSize,Chunk::OriginOrigin,uptrAlignment,boolZeroContents)
Defined at line 354 of file ../../third_party/scudo/src/combined.h
void deallocate (void * Ptr, Chunk::Origin Origin)
Defined at line 447 of file ../../third_party/scudo/src/combined.h
void deallocateSized (void *Ptr,Chunk::OriginOrigin,uptrDeleteSize)
Defined at line 451 of file ../../third_party/scudo/src/combined.h
void deallocateSizedAligned (void *Ptr,Chunk::OriginOrigin,uptrDeleteSize,uptrDeleteAlignment)
Defined at line 457 of file ../../third_party/scudo/src/combined.h
void deallocateAligned (void *Ptr,Chunk::OriginOrigin,uptrDeleteAlignment)
Defined at line 464 of file ../../third_party/scudo/src/combined.h
void checkSizeMatch (const void *Ptr,Chunk::UnpackedHeader *Header,uptrSize,uptrDeallocSize)
Defined at line 470 of file ../../third_party/scudo/src/combined.h
void checkTypeMatch (AllocatorActionAction,const void *Ptr,u8AllocOrigin,u8DeallocOrigin)
Defined at line 481 of file ../../third_party/scudo/src/combined.h
void deallocate (void *Ptr,u8DeallocOrigin,uptrDeleteSize,uptrDeleteAlignment)
Defined at line 505 of file ../../third_party/scudo/src/combined.h
void * reallocate (void *OldPtr,uptrNewSize,uptrAlignment)
Defined at line 566 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 687 of file ../../third_party/scudo/src/combined.h
void enable ()
Defined at line 701 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 720 of file ../../third_party/scudo/src/combined.h
void printStats ()
Defined at line 732 of file ../../third_party/scudo/src/combined.h
void printFragmentationInfo ()
Defined at line 738 of file ../../third_party/scudo/src/combined.h
void releaseToOS (ReleaseToOS ReleaseType)
Defined at line 745 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 757 of file ../../third_party/scudo/src/combined.h
bool canReturnNull ()
Defined at line 808 of file ../../third_party/scudo/src/combined.h
bool setOption (Option O, sptr Value)
Defined at line 813 of file ../../third_party/scudo/src/combined.h
uptr getUsableSize (const void * Ptr, Chunk::UnpackedHeader * Header)
Defined at line 840 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 860 of file ../../third_party/scudo/src/combined.h
uptr getAllocSize (const void * Ptr)
Defined at line 886 of file ../../third_party/scudo/src/combined.h
void getStats (StatCounters S)
Defined at line 905 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 913 of file ../../third_party/scudo/src/combined.h
bool useMemoryTaggingTestOnly ()
Defined at line 930 of file ../../third_party/scudo/src/combined.h
void disableMemoryTagging ()
Defined at line 933 of file ../../third_party/scudo/src/combined.h
void setTrackAllocationStacks (bool Track)
Defined at line 947 of file ../../third_party/scudo/src/combined.h
void setFillContents (FillContentsMode FillContents)
Defined at line 961 of file ../../third_party/scudo/src/combined.h
void setAddLargeAllocationSlack (bool AddSlack)
Defined at line 966 of file ../../third_party/scudo/src/combined.h
const char * getStackDepotAddress ()
Defined at line 974 of file ../../third_party/scudo/src/combined.h
uptr getStackDepotSize ()
Defined at line 980 of file ../../third_party/scudo/src/combined.h
const char * getRegionInfoArrayAddress ()
Defined at line 986 of file ../../third_party/scudo/src/combined.h
uptr getRegionInfoArraySize ()
Defined at line 990 of file ../../third_party/scudo/src/combined.h
const char * getRingBufferAddress ()
Defined at line 994 of file ../../third_party/scudo/src/combined.h
uptr getRingBufferSize ()
Defined at line 999 of file ../../third_party/scudo/src/combined.h
void collectTraceMaybe (const StackDepot *Depot,uintptr_t (&)[64]Trace,u32Hash)
Defined at line 1009 of file ../../third_party/scudo/src/combined.h
void getErrorInfo (struct scudo_error_info *ErrorInfo,uintptr_tFaultAddr,const char *DepotPtr,size_tDepotSize,const char *RegionInfoPtr,const char *RingBufferPtr,size_tRingBufferSize,const char *Memory,const char *MemoryTags,uintptr_tMemoryAddr,size_tMemorySize)
Defined at line 1018 of file ../../third_party/scudo/src/combined.h
uptr getBlockBeginTestOnly (const void * Ptr)
Defined at line 1066 of file ../../third_party/scudo/src/combined.h