nlib
NMallocSettings Struct Reference

Declares parameters that are initialized by nmalloc. Set by defining nmalloc_get_settings. More...

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

Public Attributes

void * addr
 Specifies a pointer to the beginning of the region used by nmalloc.
 
size_t size
 Specifies the maximum amount of memory that can be used by nmalloc. You must specify a multiple of 4096 bytes. More...
 
unsigned int heap_option
 Specifies the heap options. The default is 0. More...
 

Detailed Description

Declares parameters that are initialized by nmalloc. Set by defining nmalloc_get_settings.

Description
The nmalloc and nfree functions allocate memory efficiently by dividing the memory that was allocated initially into small chunks. Parameters like the amount of memory can be set by defining nmalloc_get_settings and setting a value for the NMallocSettings-type structure.
If a non-NULL value is specified in addr, nmalloc allocates memory from the memory space (the array etc.) specified in the addr and size member variables. If NULL is specified in addr and a non-zero value (multiple of 4096) is specified in size, memory is allocated and freed using a function such as nlib_virtual_alloc.
If NULL is specified in addr and 0 is specified in size, nmalloc is disabled. The default settings are { NULL, 0, 0 }.
Examples:
heap/nmalloc_leakcheck/nmalloc_leakcheck.cpp, heap/nmalloc_simple/nmalloc_simple.cpp, heap/nmalloc_withstl/nmalloc_withstl.cpp, heap/replace_malloc/replace_malloc.cpp, oss/binarypatch/binarypatch.cpp, oss/readsqldb/readsqldb.cpp, and oss/sqlfromc/sqlfromc.cpp.

Definition at line 50 of file NMalloc.h.


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