Lines Matching refs:ptr
13 ptr::NonNull,
26 unsafe fn local_dealloc(&self, ptr: *mut u8, layout: Layout); in local_dealloc()
54 pub(super) unsafe fn free_in_buddy(&self, ptr: *mut u8, layout: Layout) { in free_in_buddy()
58 let phy_addr = MMArch::virt_2_phys(VirtAddr::new(ptr as usize)).unwrap(); in free_in_buddy()
70 .unwrap_or(core::ptr::null_mut()); in local_alloc()
75 return core::ptr::null_mut(); in local_alloc()
84 let ptr: *mut u8 = x.as_mut_ptr(); in local_alloc_zeroed() localVariable
85 core::ptr::write_bytes(ptr, 0, x.len()); in local_alloc_zeroed()
86 ptr in local_alloc_zeroed()
88 .unwrap_or(core::ptr::null_mut()); in local_alloc_zeroed()
93 return core::ptr::null_mut(); in local_alloc_zeroed()
97 unsafe fn local_dealloc(&self, ptr: *mut u8, layout: Layout) { in local_dealloc()
98 if allocator_select_condition(layout) || ((ptr as usize) % 4096) == 0 { in local_dealloc()
99 self.free_in_buddy(ptr, layout) in local_dealloc()
101 slab.deallocate(ptr, layout).unwrap() in local_dealloc()
128 unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) { in dealloc()
129 if allocator_select_condition(layout) || ((ptr as usize) % 4096) == 0 { in dealloc()
130 dealloc_debug_log(klog_types::LogSource::Buddy, layout, ptr); in dealloc()
132 dealloc_debug_log(klog_types::LogSource::Slab, layout, ptr); in dealloc()
134 self.local_dealloc(ptr, layout); in dealloc()
143 fn alloc_debug_log(source: LogSource, layout: Layout, ptr: *mut u8) { in alloc_debug_log()
145 klog_types::AllocatorLogType::Alloc(AllocLogItem::new(layout, Some(ptr as usize), None)), in alloc_debug_log()
150 fn dealloc_debug_log(source: LogSource, layout: Layout, ptr: *mut u8) { in dealloc_debug_log()
152 klog_types::AllocatorLogType::Free(AllocLogItem::new(layout, Some(ptr as usize), None)), in dealloc_debug_log()