#include <platform.h>
Public Member Functions | |
| virtual | ~AllocationSampler ()=default |
| virtual size_t | GetSampleInterval () const |
| virtual bool | OnAllocated (void *address, size_t size)=0 |
| virtual void | OnFreed (void *address)=0 |
| virtual bool | OnMove (void *from, void *to, size_t size)=0 |
Interface for observing object-level allocations and deallocations in cppgc.
Implementations of these methods must not allocate on the managed heap(s) (C++ or JS) or otherwise call back into V8.
|
virtualdefault |
|
inlinevirtual |
Returns the desired sampling interval in bytes. Embedders must return a non-zero value to activate periodic sampling. Must not allocate on the managed heap(s) (C++ or JS) or otherwise call back into V8.
|
pure virtual |
Invoked when an object or memory chunk is allocated. Must not allocate on the managed heap(s) (C++ or JS) or otherwise call back into V8.
| address | Pointer to the allocated memory. |
| size | Total size of the allocation in bytes (including object header). |
|
pure virtual |
Invoked when an allocated object or memory chunk is freed/reclaimed. Must not allocate on the managed heap(s) (C++ or JS) or otherwise call back into V8.
| address | Pointer to the allocated memory. |
|
pure virtual |
Invoked when a sampled object is moved to a new location. Must not allocate on the managed heap(s) (C++ or JS) or otherwise call back into V8.
| from | Pointer to the old memory location. |
| to | Pointer to the new memory location. |
| size | Total size of the allocation in bytes (including object header). |