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

Method set

lab8/src/4/src/utils/bitmap.cpp:30–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28}
29
30void BitMap::set(const int index, const bool status)
31{
32 int pos = index / 8;
33 int offset = index % 8;
34
35 // 清0
36 bitmap[pos] = bitmap[pos] & (~(1 << offset));
37
38 // 置1
39 if (status)
40 {
41 bitmap[pos] = bitmap[pos] | (1 << offset);
42 }
43}
44
45int BitMap::allocate(const int count)
46{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected