3 #ifndef INCLUDE_NN_NLIB_HEAP_CENTRALHEAP_H_
4 #define INCLUDE_NN_NLIB_HEAP_CENTRALHEAP_H_
8 #if defined(_MSC_VER) && defined(nx_heap_EXPORTS)
10 #define NLIB_VIS_PUBLIC NLIB_WINEXPORT
20 typedef void (*DestructorHandler)(
void* start,
void* end);
23 m_UseVirtualMemory(false),
29 void Finalize() NLIB_NOEXCEPT;
34 bool IsClean() NLIB_NOEXCEPT;
36 void CalcHeapHash(
HeapHash* hash) NLIB_NOEXCEPT;
44 TlsHeapCentral* m_Central;
45 bool m_UseVirtualMemory;
46 uint32_t m_HeapOption;
55 #if defined(_MSC_VER) && defined(nx_heap_EXPORTS)
56 #undef NLIB_VIS_PUBLIC
57 #define NLIB_VIS_PUBLIC NLIB_WINIMPORT
60 #endif // INCLUDE_NN_NLIB_HEAP_CENTRALHEAP_H_
#define NLIB_NOEXCEPT
Defines noexcept geared to the environment, or the equivalent.
int(* nmalloc_heapwalk_callback)(void *allocated_ptr, size_t size, void *user_ptr)
User-defined callback function that is called from nmalloc_walk_allocated_ptrs.
void Dump() const noexcept
Runs DumpEx(NMALLOC_DUMP_BASIC, 1).
CentralHeap() noexcept
Instantiates the object with default parameters (default constructor).
#define NLIB_FINAL
Defines final if it is available for use. If not, holds an empty string.
#define NLIB_DISALLOW_COPY_AND_ASSIGN(TypeName)
Prohibits use of the copy constructor and assignment operator for the class specified by TypeName...
File that defines functions including nmalloc and nfree.
~CentralHeap() noexcept
Destructor.
static const size_t kPageSize
Page size of the heap (not related to the operating system page size).
Central heap class whose use is paired with CachedHeap. It is used to implement nmalloc.
void DumpEx(NMallocDumpMode mode) const noexcept
For more information, see nmalloc_dumpex.
void * Alloc(size_t n) noexcept
Allocates a memory block.
Only displays basic information.
Thread-specific cache class whose use is paired with CentralHeap.
NMallocDumpMode
Type of the argument to pass to nmalloc_dumpex.
Structure that contains a summary of the memory usage status of the heap used by the user application...