template <class Derived>
class MemMapBase
Defined at line 20 of file ../../third_party/scudo/src/mem_map_base.h
In Scudo, every memory operation will be fulfilled through a
platform-specific `MemMap` instance. The essential APIs are listed in the
`MemMapBase` below. This is implemented in CRTP, so for each implementation,
it has to implement all of the 'Impl' named functions.
Public Methods
void MemMapBase<Derived> ()
Defined at line 22 of file ../../third_party/scudo/src/mem_map_base.h
bool map (uptr Addr, uptr Size, const char * Name, uptr Flags)
This is used to map a new set of contiguous pages. Note that the `Addr` is
only a suggestion to the system.
Defined at line 26 of file ../../third_party/scudo/src/mem_map_base.h
void unmap (uptr Addr, uptr Size)
This is used to unmap partial/full pages from the beginning or the end.
I.e., the result pages are expected to be still contiguous.
Defined at line 33 of file ../../third_party/scudo/src/mem_map_base.h
void unmap ()
A default implementation to unmap all pages.
Defined at line 39 of file ../../third_party/scudo/src/mem_map_base.h
bool remap (uptr Addr, uptr Size, const char * Name, uptr Flags)
This is used to remap a mapped range (either from map() or dispatched from
ReservedMemory). For example, we have reserved several pages and then we
want to remap them with different accessibility.
Defined at line 44 of file ../../third_party/scudo/src/mem_map_base.h
void setMemoryPermission (uptr Addr, uptr Size, uptr Flags)
This is used to update the pages' access permission. For example, mark
pages as no read/write permission.
Defined at line 52 of file ../../third_party/scudo/src/mem_map_base.h
void releasePagesToOS (uptr From, uptr Size)
Suggest releasing a set of contiguous physical pages back to the OS. Note
that only physical pages are supposed to be released. Any release of
virtual pages may lead to undefined behavior.
Defined at line 61 of file ../../third_party/scudo/src/mem_map_base.h
void releaseAndZeroPagesToOS (uptr From, uptr Size)
This is similar to the above one except that any subsequent access to the
released pages will return with zero-filled pages.
Defined at line 68 of file ../../third_party/scudo/src/mem_map_base.h
uptr getBase ()
Defined at line 74 of file ../../third_party/scudo/src/mem_map_base.h
uptr getCapacity ()
Defined at line 75 of file ../../third_party/scudo/src/mem_map_base.h
bool isAllocated ()
Defined at line 77 of file ../../third_party/scudo/src/mem_map_base.h
Protected Methods
template <typename R, typename... Args>
R invokeImpl (R (Derived::*)(Args...) MemFn, Args... args)
Defined at line 81 of file ../../third_party/scudo/src/mem_map_base.h