Compare commits

...
2 Commits
Author SHA1 Message Date
juju bc0c885052 add memory allocation for thread stack
continuous-integration/drone/push Build is passing
Signed-off-by: Julien CLEMENT <julien.clement@epita.fr>
2022-12-31 00:05:17 +01:00
juju 268b36188e start thread new
Signed-off-by: Julien CLEMENT <julien.clement@epita.fr>
2022-12-30 23:51:03 +01:00
+14
View File
@@ -1,3 +1,17 @@
use alloc::alloc::{alloc, dealloc, Layout};
const STACK_SIZE: usize = 4096 * 20;
pub struct Thread {
rsp: u64
}
impl Thread {
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.