add memory allocation for thread stack
continuous-integration/drone/push Build is passing

Signed-off-by: Julien CLEMENT <julien.clement@epita.fr>
This commit is contained in:
juju committed 2022-12-31 00:05:17 +01:00
1 parent 268b36188e
commit bc0c885052
1 file changed
+10 -2
+10 -2
View File
@@ -1,9 +1,17 @@
use alloc::alloc::{alloc, dealloc, Layout};
const STACK_SIZE: usize = 4096 * 20;
pub struct Thread { pub struct Thread {
rsp: u64 rsp: u64
} }
impl Thread { impl Thread {
pub fn new() { pub fn new() -> Self {
unsafe {
Thread {
rsp: alloc(Layout::new::<[u8; STACK_SIZE]>()) as u64,
}
}
} }
} }
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.