From ab6cf8237b5d72bf996dc93fd9e0c77124dc3de8 Mon Sep 17 00:00:00 2001 From: Christian Cunningham Date: Sun, 21 Aug 2022 09:51:29 -0700 Subject: Colorize debug info output --- src/mem/alloc.rs | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/mem/alloc.rs') diff --git a/src/mem/alloc.rs b/src/mem/alloc.rs index e104293..f3a8c8d 100644 --- a/src/mem/alloc.rs +++ b/src/mem/alloc.rs @@ -127,7 +127,7 @@ impl<'a, T: Sized,const COUNT: usize> QueueAllocator<'a, T, COUNT> { } _ => {} } - vprintln!("QA: Allocating {:x}", unsafe{(*entry).ptr() as usize}); + vprintln!("QA: \x1b[92mAllocated {:x}\x1b[0m", unsafe{(*entry).ptr() as usize}); return Some(unsafe{&mut *entry as &mut QueueItem<'a,T>}); } else { vprintln!("QA: No chunks available!"); @@ -156,7 +156,7 @@ impl<'a, T: Sized,const COUNT: usize> QueueAllocator<'a, T, COUNT> { } } pool[1].next = Some(freed_item as *mut QueueItem<'a,T>); - vprintln!("QA: Deallocated {:x}", freed_item.ptr() as usize); + vprintln!("QA: \x1b[91mDeallocated {:x}\x1b[0m", freed_item.ptr() as usize); }); } } @@ -257,27 +257,27 @@ init_queue!(U4096_GRAND_ALLOC, GRAND_ALLOC_SIZE, {U4096::new()}, U4096); impl GrandAllocator { pub fn init(&self) -> Result<(), &'static str> { - vprintln!("GA: Init U8 Pool"); + vprintln!("GA: \x1b[93mInit U8 Pool\x1b[0m"); U8_GRAND_ALLOC.init(); - vprintln!("GA: Init U16 Pool"); + vprintln!("GA: \x1b[93mInit U16 Pool\x1b[0m"); U16_GRAND_ALLOC.init(); - vprintln!("GA: Init U32 Pool"); + vprintln!("GA: \x1b[93mInit U32 Pool\x1b[0m"); U32_GRAND_ALLOC.init(); - vprintln!("GA: Init U64 Pool"); + vprintln!("GA: \x1b[93mInit U64 Pool\x1b[0m"); U64_GRAND_ALLOC.init(); - vprintln!("GA: Init U128 Pool"); + vprintln!("GA: \x1b[93mInit U128 Pool\x1b[0m"); U128_GRAND_ALLOC.init(); - vprintln!("GA: Init U256 Pool"); + vprintln!("GA: \x1b[93mInit U256 Pool\x1b[0m"); U256_GRAND_ALLOC.init(); - vprintln!("GA: Init U512 Pool"); + vprintln!("GA: \x1b[93mInit U512 Pool\x1b[0m"); U512_GRAND_ALLOC.init(); - vprintln!("GA: Init U1024 Pool"); + vprintln!("GA: \x1b[93mInit U1024 Pool\x1b[0m"); U1024_GRAND_ALLOC.init(); - vprintln!("GA: Init U2048 Pool"); + vprintln!("GA: \x1b[93mInit U2048 Pool\x1b[0m"); U2048_GRAND_ALLOC.init(); - vprintln!("GA: Init U4096 Pool"); + vprintln!("GA: \x1b[93mInit U4096 Pool\x1b[0m"); U4096_GRAND_ALLOC.init(); - vprintln!("GA: Pools Initialized!"); + vprintln!("GA: \x1b[94mPools Initialized!\x1b[0m"); Ok(()) } } -- cgit v1.2.1