16 #ifndef INCLUDE_NN_NLIB_HEAP_CENTRALHEAP_H_ 17 #define INCLUDE_NN_NLIB_HEAP_CENTRALHEAP_H_ 21 #if defined(_MSC_VER) && defined(nx_heap_EXPORTS) 22 #undef NLIB_VIS_PUBLIC 23 #define NLIB_VIS_PUBLIC NLIB_WINEXPORT 33 typedef void (*DestructorHandler)(
void* start,
void* end) NLIB_NOEXCEPT_FUNCPTR;
36 use_virtual_memory_(false),
57 TlsHeapCentral* central_;
58 bool use_virtual_memory_;
59 uint32_t heap_option_;
68 #if defined(_MSC_VER) && defined(nx_heap_EXPORTS) 69 #undef NLIB_VIS_PUBLIC 70 #define NLIB_VIS_PUBLIC NLIB_WINIMPORT 73 #endif // INCLUDE_NN_NLIB_HEAP_CENTRALHEAP_H_ 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.
CentralHeap() noexcept
Instantiates the object with default parameters (default constructor).
#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 * Alloc(size_t n) noexcept
Allocates a memory block.
#define NLIB_NOEXCEPT
Defines noexcept geared to the environment, or the equivalent.
Thread-specific cache class whose use is paired with CentralHeap.
#define NLIB_FINAL
Defines final if it is available for use. If not, holds an empty string.