MCPcopy Create free account
hub / github.com/YatSenOS/YatSenOS-Tutorial-Volume-1 / allocate

Method allocate

lab8/src/2/src/utils/address_pool.cpp:16–20  ·  view source on GitHub ↗

从地址池中分配count个连续页

Source from the content-addressed store, hash-verified

14
15// 从地址池中分配count个连续页
16int AddressPool::allocate(const int count)
17{
18 int start = resources.allocate(count);
19 return (start == -1) ? -1 : (start * PAGE_SIZE + startAddress);
20}
21
22// 释放若干页的空间
23void AddressPool::release(const int address, const int amount)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected