[kernel] Clean up threads' kernel stacks on exit
Add a destructor to threads in order to deallocate their kernel stacks.
This commit is contained in:
@@ -37,6 +37,11 @@ thread::thread(process &parent, uint8_t pri, uintptr_t rsp0) :
|
||||
set_state(state::ready);
|
||||
}
|
||||
|
||||
thread::~thread()
|
||||
{
|
||||
kutil::kfree(reinterpret_cast<void*>(m_tcb.kernel_stack));
|
||||
}
|
||||
|
||||
thread *
|
||||
thread::from_tcb(TCB *tcb)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user