MCPcopy Create free account
hub / github.com/LibertyOS-Development/kernel / sizealign

Method sizealign

src/allocator/lnls.rs:129–137  ·  view source on GitHub ↗

Modify specified layout so that the allocated memory region can also hold a ListNode: NOTE: This will return a tuple, consisting of the adjusted size, and the alignment (size, align).

(layout: Layout)

Source from the content-addressed store, hash-verified

127 // Modify specified layout so that the allocated memory region can also hold a ListNode:
128 // NOTE: This will return a tuple, consisting of the adjusted size, and the alignment (size, align).
129 fn sizealign(layout: Layout) -> (usize, usize)
130 {
131 let layout = layout
132 .align_to(mem::align_of::<ListNode>())
133 .expect("[ERR] FAILED TO ADJUST ALIGNMENT")
134 .pad_to_align();
135 let size = layout.size().max(mem::size_of::<ListNode>());
136 (size, layout.align())
137 }
138}
139
140

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected