mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 14:27:49 +00:00
Panic on alloc::oom instead of calling intrinsics::abort (#375)
This commit is contained in:
committed by
Philipp Oppermann
parent
2e8da22b32
commit
5e937e6e20
@@ -41,6 +41,10 @@ unsafe impl<'a> Alloc for &'a BumpAllocator {
|
||||
unsafe fn dealloc(&mut self, ptr: *mut u8, layout: Layout) {
|
||||
// do nothing, leak memory
|
||||
}
|
||||
|
||||
fn oom(&mut self, _: AllocErr) -> ! {
|
||||
panic!("Out of memory");
|
||||
}
|
||||
}
|
||||
|
||||
/// Align downwards. Returns the greatest x with alignment `align`
|
||||
|
||||
Reference in New Issue
Block a user