InitializeAllocator

nn::init::InitializeAllocator Function

Syntax

void InitializeAllocator(
     size_t size
);

Parameters

Name Description
in size The amount of memory to allocate from the heap for the allocator.

Return Values

None.

Description

Initializes a simple allocator.

Allocates nn::os::MemoryBlock from the heap and creates an allocator to manage that memory region.

The purpose of this function is to enable you to put off the construction of an independent memory-management mechanism so you can more quickly verify operations during the early stages of development.

When you are ready to really delve into application development, we recommend that you construct an independent memory-management mechanism rather than use this function.

By default in the SDK, new and malloc request the allocator created by this function for actual allocations of memory. As a result, the size of memory that can be allocated using new and malloc is determined by the value specified for size in this function.

Before calling this function you must call the nn::os::InitializeMemoryBlock function.


CONFIDENTIAL