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 147 of file ../../third_party/scudo/src/combined.h

void enableRingBuffer ()

Defined at line 206 of file ../../third_party/scudo/src/combined.h

void disableRingBuffer ()

Defined at line 213 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 222 of file ../../third_party/scudo/src/combined.h

const gwp_asan::AllocationMetadata * getGwpAsanAllocationMetadata ()

Defined at line 253 of file ../../third_party/scudo/src/combined.h

const gwp_asan::AllocatorState * getGwpAsanAllocatorState ()

Defined at line 257 of file ../../third_party/scudo/src/combined.h

void initThreadMaybe (bool MinimalInit)

Defined at line 262 of file ../../third_party/scudo/src/combined.h

void unmapTestOnly ()

Defined at line 266 of file ../../third_party/scudo/src/combined.h

TSDRegistryT * getTSDRegistry ()

Defined at line 278 of file ../../third_party/scudo/src/combined.h

QuarantineT * getQuarantine ()

Defined at line 279 of file ../../third_party/scudo/src/combined.h

void initAllocator (SizeClassAllocatorT * SizeClassAllocator)

The Cache must be provided zero-initialized.

Defined at line 282 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 291 of file ../../third_party/scudo/src/combined.h

void drainCache (TSD<ThisT> * TSD)

Defined at line 300 of file ../../third_party/scudo/src/combined.h

void drainCaches ()

Defined at line 309 of file ../../third_party/scudo/src/combined.h

void * getHeaderTaggedPointer (void * Ptr)

Defined at line 311 of file ../../third_party/scudo/src/combined.h

uptr addHeaderTag (uptr Ptr)

Defined at line 323 of file ../../third_party/scudo/src/combined.h

void * addHeaderTag (void * Ptr)

Defined at line 329 of file ../../third_party/scudo/src/combined.h

u32 collectStackTrace (StackDepot * Depot)

Defined at line 333 of file ../../third_party/scudo/src/combined.h

uptr computeOddEvenMaskForPointerMaybe (const Options & Options, uptr Ptr, uptr ClassId)

Defined at line 347 of file ../../third_party/scudo/src/combined.h

void * allocate (uptr Size, Chunk::Origin Origin, uptr Alignment, bool ZeroContents)

Defined at line 360 of file ../../third_party/scudo/src/combined.h

void deallocate (void * Ptr, Chunk::Origin Origin)

Defined at line 453 of file ../../third_party/scudo/src/combined.h

void deallocateSized (void * Ptr, Chunk::Origin Origin, uptr DeleteSize)

Defined at line 457 of file ../../third_party/scudo/src/combined.h

void deallocateSizedAligned (void * Ptr, Chunk::Origin Origin, uptr DeleteSize, uptr DeleteAlignment)

Defined at line 463 of file ../../third_party/scudo/src/combined.h

void deallocateAligned (void * Ptr, Chunk::Origin Origin, uptr DeleteAlignment)

Defined at line 470 of file ../../third_party/scudo/src/combined.h

void checkSizeMatch (const void * Ptr, Chunk::UnpackedHeader * Header, uptr Size, uptr DeallocSize)

Defined at line 476 of file ../../third_party/scudo/src/combined.h

void checkTypeMatch (AllocatorAction Action, const void * Ptr, u8 AllocOrigin, u8 DeallocOrigin)

Defined at line 487 of file ../../third_party/scudo/src/combined.h

void deallocate (void * Ptr, u8 DeallocOrigin, uptr DeleteSize, uptr DeleteAlignment)

Defined at line 511 of file ../../third_party/scudo/src/combined.h

void * reallocate (void * OldPtr, uptr NewSize, uptr Alignment)

Defined at line 572 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 679 of file ../../third_party/scudo/src/combined.h

void enable (bool IsChild)

Defined at line 693 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 712 of file ../../third_party/scudo/src/combined.h

void printStats ()

Defined at line 724 of file ../../third_party/scudo/src/combined.h

void printFragmentationInfo ()

Defined at line 730 of file ../../third_party/scudo/src/combined.h

void releaseToOS (ReleaseToOS ReleaseType)

Defined at line 737 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 749 of file ../../third_party/scudo/src/combined.h

bool canReturnNull ()

Defined at line 795 of file ../../third_party/scudo/src/combined.h

bool setOption (Option O, sptr Value)

Defined at line 800 of file ../../third_party/scudo/src/combined.h

uptr getUsableSize (const void * Ptr, Chunk::UnpackedHeader * Header)

Defined at line 827 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 847 of file ../../third_party/scudo/src/combined.h

uptr getAllocSize (const void * Ptr)

Defined at line 873 of file ../../third_party/scudo/src/combined.h

void getStats (StatCounters S)

Defined at line 892 of file ../../third_party/scudo/src/combined.h

bool isOwnedTestOnly (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 900 of file ../../third_party/scudo/src/combined.h

bool useMemoryTaggingTestOnly ()

Defined at line 917 of file ../../third_party/scudo/src/combined.h

void disableMemoryTagging ()

Defined at line 921 of file ../../third_party/scudo/src/combined.h

void setTrackAllocationStacks (bool Track)

Defined at line 935 of file ../../third_party/scudo/src/combined.h

void setFillContents (FillContentsMode FillContents)

Defined at line 949 of file ../../third_party/scudo/src/combined.h

void setAddLargeAllocationSlack (bool AddSlack)

Defined at line 954 of file ../../third_party/scudo/src/combined.h

void getErrorInfo (uptr FaultAddr, size_t MinDistance, size_t MaxDistance, scudo_error_report * Reports, size_t & ReportIndex)

Defined at line 962 of file ../../third_party/scudo/src/combined.h

void getRingBufferErrorInfo (uintptr_t FaultAddr, scudo_error_report * Reports, size_t & ReportIndex)

Defined at line 1029 of file ../../third_party/scudo/src/combined.h

void getErrorInfo (uintptr_t FaultAddr, struct scudo_error_info * ErrorInfo)

Defined at line 1118 of file ../../third_party/scudo/src/combined.h

void collectTraceMaybe (const StackDepot * Depot, uintptr_t (&)[64] Trace, u32 Hash)

Defined at line 1142 of file ../../third_party/scudo/src/combined.h

uptr getBlockBeginTestOnly (const void * Ptr)

Defined at line 1151 of file ../../third_party/scudo/src/combined.h

bool getRingBufferEnabledTestOnly ()

Defined at line 1164 of file ../../third_party/scudo/src/combined.h

const void * getRingBufferAddressTestOnly ()

Defined at line 1169 of file ../../third_party/scudo/src/combined.h

bool getStackDepotEnabledTestOnly ()

Defined at line 1174 of file ../../third_party/scudo/src/combined.h

const void * getStackDepotAddressTestOnly ()

Defined at line 1182 of file ../../third_party/scudo/src/combined.h

Records