Home
last modified time | relevance | path

Searched refs:layout (Results 1 – 10 of 10) sorted by relevance

/DragonOS/kernel/src/mm/allocator/
H A Dkernel_allocator.rs24 unsafe fn local_alloc(&self, layout: Layout) -> *mut u8; in local_alloc()
25 unsafe fn local_alloc_zeroed(&self, layout: Layout) -> *mut u8; in local_alloc_zeroed()
26 unsafe fn local_dealloc(&self, ptr: *mut u8, layout: Layout); in local_dealloc()
32 unsafe fn alloc_in_buddy(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError> { in alloc_in_buddy()
34 let count = (page_align_up(layout.size()) / MMArch::PAGE_SIZE).next_power_of_two(); in alloc_in_buddy()
54 pub(super) unsafe fn free_in_buddy(&self, ptr: *mut u8, layout: Layout) { in free_in_buddy()
56 let count = (page_align_up(layout.size()) / MMArch::PAGE_SIZE).next_power_of_two(); in free_in_buddy()
65 unsafe fn local_alloc(&self, layout: Layout) -> *mut u8 { in local_alloc()
66 if allocator_select_condition(layout) { in local_alloc()
68 .alloc_in_buddy(layout) in local_alloc()
[all …]
H A Dslab.rs33 pub(crate) unsafe fn allocate(&mut self, layout: Layout) -> *mut u8 { in allocate()
34 match self.zone.allocate(layout) { in allocate()
40 .refill(layout, leaked_page) in allocate()
43 .allocate(layout) in allocate()
55 layout: Layout, in deallocate()
59 .deallocate(nptr, layout, &SLAB_CALLBACK) in deallocate()
/DragonOS/kernel/crates/rust-slabmalloc/src/
H A Dzone.rs159 fn allocate(&mut self, layout: Layout) -> Result<NonNull<u8>, AllocationError> { in allocate()
160 match ZoneAllocator::get_slab(layout.size()) { in allocate()
161 Slab::Base(idx) => self.small_slabs[idx].allocate(layout), in allocate()
176 layout: Layout, in deallocate()
179 match ZoneAllocator::get_slab(layout.size()) { in deallocate()
180 Slab::Base(idx) => self.small_slabs[idx].deallocate(ptr, layout, slab_callback), in deallocate()
191 layout: Layout, in refill()
194 match ZoneAllocator::get_slab(layout.size()) { in refill()
H A Dpages.rs15 layout: Layout, in first_fit()
59 layout: Layout, in first_fit()
62 let start_offset = get_offset_for_align(layout); in first_fit()
73 let offset = idx * layout.size(); in first_fit()
77 offset <= (page_size - OBJECT_PAGE_METADATA_OVERHEAD - layout.size()); in first_fit()
83 let alignment_ok = addr % layout.align() == 0; in first_fit()
171 fn get_offset_for_align(layout: Layout) -> usize { in get_offset_for_align()
172 match layout.size() { in get_offset_for_align()
210 fn first_fit(&self, layout: Layout) -> Option<(usize, usize)> { in first_fit()
212 self.bitfield().first_fit(base_addr, layout, Self::SIZE) in first_fit()
[all …]
H A Dsc.rs262 pub fn allocate(&mut self, layout: Layout) -> Result<NonNull<u8>, AllocationError> { in allocate()
266 layout in allocate()
268 assert!(layout.size() <= self.size); in allocate()
270 let new_layout = unsafe { Layout::from_size_align_unchecked(self.size, layout.align()) }; in allocate()
271 assert!(new_layout.size() >= layout.size()); in allocate()
282 let ptr = empty_page.allocate(layout); in allocate()
320 layout: Layout, in deallocate()
323 assert!(layout.size() <= self.size); in deallocate()
329 layout, in deallocate()
338 let new_layout = unsafe { Layout::from_size_align_unchecked(self.size, layout.align()) }; in deallocate()
H A Dlib.rs67 fn allocate(&mut self, layout: Layout) -> Result<NonNull<u8>, AllocationError>; in allocate()
71 layout: Layout, in deallocate()
81 layout: Layout, in refill()
/DragonOS/kernel/src/libs/
H A Dalign.rs31 let layout = core::alloc::Layout::from_size_align( localVariable
36 if let Ok(layout) = layout {
37 layout
/DragonOS/kernel/crates/klog_types/src/
H A Dlib.rs130 pub layout: core::alloc::Layout, field
136 pub fn new(layout: core::alloc::Layout, vaddr: Option<usize>, paddr: Option<usize>) -> Self { in new()
138 layout, in new()
148 .field("layout", &self.layout) in fmt()
/DragonOS/docs/community/ChangeLog/V0.1.x/
H A DV0.1.6.md262 * layout.html末尾加空行
/DragonOS/kernel/crates/intertrait/
H A DREADME.md146 In the course, it doesn't rely on any unstable Rust implementation details such as the layout of tr…