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

Function lsidx

src/allocator/fixedsize.rs:14–18  ·  view source on GitHub ↗
(layout: &Layout)

Source from the content-addressed store, hash-verified

12// NOTE: Blocksize must be a power of two (2).
13
14fn lsidx(layout: &Layout) -> Option<usize>
15{
16 let req_blksize = layout.size().max(layout.align());
17 BLKSIZES.iter().position(|&s| s >= req_blksize)
18}
19
20// Pair an appropriate blocksize for the specific layout in question. This returns an index into BLKSIZES.
21struct ListNode

Callers 2

allocMethod · 0.85
deallocMethod · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected