MCPcopy Create free account
hub / github.com/chyyuu/os_kernel_lab / alloc

Method alloc

os/src/task/id.rs:23–30  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

21 }
22 }
23 pub fn alloc(&mut self) -> usize {
24 if let Some(id) = self.recycled.pop() {
25 id
26 } else {
27 self.current += 1;
28 self.current - 1
29 }
30 }
31 pub fn dealloc(&mut self, id: usize) {
32 assert!(id < self.current);
33 assert!(

Callers 3

alloc_tidMethod · 0.45
pid_allocFunction · 0.45
kstack_allocFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected