MCPcopy Create free account
hub / github.com/MemNixFS/MemNixFS / match_swapper

Function match_swapper

src/os/linux/kernel_resolver.cpp:24–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22};
23
24bool match_swapper(const u8* p, std::size_t left) {
25 // "swapper" = 7 bytes; then ("/0" or "\0\0") = 2 bytes; then 7x NUL.
26 if (left < 16) return false;
27 if (std::memcmp(p, "swapper", 7) != 0) return false;
28 bool tail_ok = (p[7] == '/' && p[8] == '0') ||
29 (p[7] == 0 && p[8] == 0);
30 if (!tail_ok) return false;
31 for (int i = 9; i < 16; ++i) if (p[i] != 0) return false;
32 return true;
33}
34
35std::vector<PAddr> scan_swapper(const PhysicalLayer& phys) {
36 std::vector<PAddr> hits;

Callers 1

scan_swapperFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected