-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update to use the new API for custom allocators. #348
Conversation
Why are you creating |
@4e554c4c |
Then add it to the .gitignore. There isn't currently a |
Ok, fixed that. |
It seems I can't use Git apparently, |
Thank you! I think this is good. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
I think we could remove the hole_list_allocator
crate completely and directly use the LockedHeap
struct.
pub extern fn __rust_allocate(size: usize, align: usize) -> *mut u8 { | ||
HEAP.lock().allocate_first_fit(size, align).expect("out of memory") | ||
//Set up the heap | ||
pub unsafe fn init(offset: usize, size: usize) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This init function isn't called right now, so the heap stays uninitialized.
I think using the LockedHeap struct is a definite possiblity, however for now I have just changed it so the heap init function does get called in |
Ok, I decided to merge this for now. Maybe we switch to LockedHeap eventually, but for now it's good to have this project buildable again. Thanks a lot @too-r! |
@@ -53,7 +53,7 @@ pub extern "C" fn rust_main(multiboot_information_address: usize) { | |||
|
|||
// initialize our IDT | |||
interrupts::init(&mut memory_controller); | |||
|
|||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trailing whitespace which was not previously here
Had to change the linked_list_allocator dependecy to link directly to git, because the version on crates.io is still using the old
Unique
API.