3 #ifndef INCLUDE_NN_NLIB_HEAP_UNITHEAP_H_ 4 #define INCLUDE_NN_NLIB_HEAP_UNITHEAP_H_ 8 #if defined(_MSC_VER) && defined(nx_heap_EXPORTS) 10 #define NLIB_VIS_PUBLIC NLIB_WINEXPORT 18 typedef void (*DestructorHandler)(
void* start,
void* end);
24 (*handler_)(start_, end_);
27 errno_t Init(
void* start,
size_t size, DestructorHandler handler,
size_t unit,
31 size_t GetUnitSize() const NLIB_NOEXCEPT {
return unit_size_; }
42 size_t baseunit_count_;
45 size_t allocated_count_;
47 uint32_t heap_option_;
50 DestructorHandler handler_;
56 #if defined(_MSC_VER) && defined(nx_heap_EXPORTS) 57 #undef NLIB_VIS_PUBLIC 58 #define NLIB_VIS_PUBLIC NLIB_WINIMPORT 61 #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.