Luna/libluna/include/luna/Stack.h
apio 5f698b4774
All checks were successful
continuous-integration/drone/push Build is passing
kernel: Don't create a new kernel stack on exec()
The old one was not getting freed, creating a memory leak every exec(),
which can get huge over time.
Plus, there was no need for a new stack.
And we couldn't just free the old one, since sys_execve() runs on the old stack...
2023-07-12 16:06:56 +02:00

25 lines
314 B
C++

#pragma once
#include <luna/Types.h>
struct Stack
{
Stack() = default;
Stack(u64 base, usize bytes);
u64 bottom() const
{
return m_base;
}
u64 top() const;
usize bytes() const
{
return m_bytes;
}
private:
u64 m_base { 0 };
usize m_bytes { 0 };
};