nn::os::AutoStackManager::Destruct Member Function
virtual void Destruct(
void * pStackBottom,
bool isError
) = 0;
| Name | Description | |
|---|---|---|
| in | pStackBottom | The stack to release. |
| in | isError | Indicates whether it is being released because an error occurred. |
Releases the memory for the stack.
This function is a pure virtual function. This function itself cannot be called. You must implement a derived class in accordance with the specifications described here.
Releases the memory region passed to pStackBottom. The value of pStackBottom is one of the values returned by the Construct function at some point before this function is called.
If isError is true, it indicates that the temporarily allocated stack must be deallocated because an error occurred while initializing a thread with the Thread::StartUsingAutoStack or Thread::TryStartUsingAutoStack function. In this situation, pStackBottom takes the value returned by the same thread's immediately previous call to the Construct function.
If isError is false, it means that the thread using the stack indicated by pStackBottom is being destroyed, so the stack will now be released.
If a derived class instance was specified by the Thread::SetAutoStackManager function, the context that is called will differ depending on the value of isError. If isError is true, the ThreadStartUsingAutoStack or Thread::TryStartUsingAutoStack function will perform the call. If isError is false, the call uses the context of the thread that is using pStackBottom.
Note: When isError is false, this function itself is using pStackBottom as its stack. Before releasing pStackBottom, you need to either change the stack to use a different memory region, or release the memory without using a stack. When isError is false, the stack is not used after control returns from this function, so it is not a problem if the stack is in an unusable state when this function returns.
CONFIDENTIAL