nlib
HeapHash Struct Reference

Structure that contains a summary of the memory usage status of the heap used by the user application. More...

#include "nn/nlib/heap/NMalloc.h"

Public Attributes

size_t alloc_count
 Number of regions allocated by the user application within the heap.
 
size_t alloc_size
 Total size of the regions allocated by the user application within the heap.
 
size_t hash
 Hash value of the status of memory allocated by the user application within the heap.
 

Detailed Description

Structure that contains a summary of the memory usage status of the heap used by the user application.

Description
Obtained using the nmalloc_heaphash function. If the object does not have the same value, the memory usage status is different. This is an easy way to check for memory leaks by comparing the value before memory is obtained with the value after memory is freed.
This structure stores the number of regions allocated to CentralHeap, the total size, and a hash value for other information. The status of metadata within CentralHeap is not reflected in this value.
Cached regions within CachedHeap are also counted as having been allocated. An accurate check can be performed by specifying NMALLOC_HEAPOPTION_CACHE_DISABLE for NMallocSettings and running in a single thread.
Examples:
heap/nmalloc_leakcheck/nmalloc_leakcheck.cpp.

Definition at line 31 of file NMalloc.h.


The documentation for this struct was generated from the following files: