16 #ifndef INCLUDE_NN_NLIB_HEAP_UNITHEAP_H_ 17 #define INCLUDE_NN_NLIB_HEAP_UNITHEAP_H_ 21 #if defined(_MSC_VER) && defined(nx_heap_EXPORTS) 22 #undef NLIB_VIS_PUBLIC 23 #define NLIB_VIS_PUBLIC NLIB_WINEXPORT 31 typedef void (*DestructorHandler)(
void* start,
void* end) NLIB_NOEXCEPT_FUNCPTR;
37 (*handler_)(start_, end_);
40 errno_t Init(
void* start,
size_t size, DestructorHandler handler,
size_t unit,
44 size_t GetUnitSize() const NLIB_NOEXCEPT {
return unit_size_; }
55 size_t baseunit_count_;
58 size_t allocated_count_;
60 uint32_t heap_option_;
63 DestructorHandler handler_;
69 #if defined(_MSC_VER) && defined(nx_heap_EXPORTS) 70 #undef NLIB_VIS_PUBLIC 71 #define NLIB_VIS_PUBLIC NLIB_WINIMPORT 74 #endif // INCLUDE_NN_NLIB_HEAP_UNITHEAP_H_ size_t GetUnitCount() const noexcept
Returns the number of regions that can be allocated from this heap.
Heap for allocating and freeing fixed-size regions of memory. This is a so-called "pool-allocator...
size_t GetAllocatedCount() const noexcept
Returns the number of regions that are currently allocated from this heap.
size_t GetUnitSize() const noexcept
Returns the size of each region that to be allocated from this heap.
#define NLIB_NOEXCEPT
Defines noexcept geared to the environment, or the equivalent.
A file that contains the configuration information for each development environment.
#define NLIB_FINAL
Defines final if it is available for use. If not, holds an empty string.