Initialize

nn::os::SimpleAutoStackManager::Initialize Member Function

Syntax

void Initialize(
     fnd::IAllocator * pAllocator,
     uptr stackBottom
);

template <typename StackT>
void Initialize(
     fnd::IAllocator * pAllocator,
     StackT & stack
);

List of Overloaded Member Functions

Initialize(fnd::IAllocator *, uptr) Performs initialization.
Initialize(fnd::IAllocator *, StackT &) Performs initialization.

Description of Initialize(fnd::IAllocator *, uptr )

Specifies the allocator that will actually perform memory allocation.

The allocator specified for pAllocator must be maintained until the call to the Finalize function. Since the allocator can be accessed from multiple threads, it must be thread-safe. Further, the allocator must be able to allocate memory regions aligned to 4-byte boundaries. In the Construct function, the value 4 is passed to the second argument of pAllocator->Allocate.

When the stack is released, stackBottom is used as the stack. Within the Destruct member functions, pAllocator->Free is called after the stack has been replaced by stackBottom. For this reason, the size of the stack pointed to by stackBottom must match the stack size used by pAllocator->Free.

Description of Initialize(fnd::IAllocator *, StackT &)

Executes Initialize(pAllocator, stack.GetStackBottom()). For details, see Initialize(fnd::IAllocator*, uptr).

StackT requires that the GetStackBottom function be called to get the bottom of the stack.


CONFIDENTIAL