diff options
-rw-r--r-- | src/kernel.rs | 18 | ||||
-rw-r--r-- | src/mem/alloc.rs | 12 |
2 files changed, 2 insertions, 28 deletions
diff --git a/src/kernel.rs b/src/kernel.rs index b0c5104..c25e148 100644 --- a/src/kernel.rs +++ b/src/kernel.rs @@ -39,7 +39,6 @@ use crate::mem::alloc::*; /// the regular main. unsafe fn kernel_init() -> ! { console().init().unwrap(); - U64_QUEUE_ALLOCATOR.init(); ALLOCATOR.init(); kernel_main() } @@ -48,24 +47,11 @@ unsafe fn kernel_init() -> ! { /// /// TODO: Figure out what to do here fn kernel_main() -> ! { - for idx in 0..5 { - if let Some(cell) = U64_QUEUE_ALLOCATOR.alloc() { - let inner = cell.inner(); - *inner = idx; - println!("SUCCESS: Allocated a char! {:?} {:?}", cell, U64_QUEUE_ALLOCATOR); - U64_QUEUE_ALLOCATOR.free(cell); - } else { - println!("ERROR: No more chars remaining! {:?}", U64_QUEUE_ALLOCATOR); - } - } println!("I should be able to print {} here!", 5); { - let a: Box<u8> = Box::new(5); + let a: Box<u8> = Box::new(u8::MAX); let b: Box<u8> = Box::new(5); - let c: Box<(u8,u8,u8)> = Box::new((3,5,8)); - println!("{:?}", a); - println!("{:?}", b); - println!("{:?}", c); + println!("{:?} {:?}", a, b); } loop { } } diff --git a/src/mem/alloc.rs b/src/mem/alloc.rs index bb22ba6..e06230d 100644 --- a/src/mem/alloc.rs +++ b/src/mem/alloc.rs @@ -277,8 +277,6 @@ unsafe impl GlobalAlloc for GrandAllocator { assert!(index < GRAND_ALLOC_SIZE); assert_eq!(diff % spacing, 0); U8_GRAND_ALLOC.free(&mut pool[index]); - #[cfg(_DEBUG_)] - crate::println!("{:?}", diff/spacing); }); } 2 => { @@ -289,8 +287,6 @@ unsafe impl GlobalAlloc for GrandAllocator { assert!(index < GRAND_ALLOC_SIZE); assert_eq!(diff % spacing, 0); U16_GRAND_ALLOC.free(&mut pool[index]); - #[cfg(_DEBUG_)] - crate::println!("{:?}", diff/spacing); }); } 3..=4 => { @@ -301,8 +297,6 @@ unsafe impl GlobalAlloc for GrandAllocator { assert!(index < GRAND_ALLOC_SIZE); assert_eq!(diff % spacing, 0); U32_GRAND_ALLOC.free(&mut pool[index]); - #[cfg(_DEBUG_)] - crate::println!("{:?}", diff/spacing); }); } 5..=8 => { @@ -313,8 +307,6 @@ unsafe impl GlobalAlloc for GrandAllocator { assert!(index < GRAND_ALLOC_SIZE); assert_eq!(diff % spacing, 0); U64_GRAND_ALLOC.free(&mut pool[index]); - #[cfg(_DEBUG_)] - crate::println!("{:?}", diff/spacing); }); } 9..=16 => { @@ -325,8 +317,6 @@ unsafe impl GlobalAlloc for GrandAllocator { assert!(index < GRAND_ALLOC_SIZE); assert_eq!(diff % spacing, 0); U128_GRAND_ALLOC.free(&mut pool[index]); - #[cfg(_DEBUG_)] - crate::println!("{:?}", diff/spacing); }); } 17..=32 => { @@ -337,8 +327,6 @@ unsafe impl GlobalAlloc for GrandAllocator { assert!(index < GRAND_ALLOC_SIZE); assert_eq!(diff % spacing, 0); U256_GRAND_ALLOC.free(&mut pool[index]); - #[cfg(_DEBUG_)] - crate::println!("{:?}", diff/spacing); }); } _ => { |