MCPcopy Create free account
hub / github.com/apache/brpc / ContainsGateVMA

Function ContainsGateVMA

src/butil/debug/proc_maps_linux.cc:31–43  ·  view source on GitHub ↗

Scans |proc_maps| starting from |pos| returning true if the gate VMA was found, otherwise returns false.

Source from the content-addressed store, hash-verified

29// Scans |proc_maps| starting from |pos| returning true if the gate VMA was
30// found, otherwise returns false.
31static bool ContainsGateVMA(std::string* proc_maps, size_t pos) {
32#if defined(ARCH_CPU_ARM_FAMILY)
33 // The gate VMA on ARM kernels is the interrupt vectors page.
34 return proc_maps->find(" [vectors]\n", pos) != std::string::npos;
35#elif defined(ARCH_CPU_X86_64)
36 // The gate VMA on x86 64-bit kernels is the virtual system call page.
37 return proc_maps->find(" [vsyscall]\n", pos) != std::string::npos;
38#else
39 // Otherwise assume there is no gate VMA in which case we shouldn't
40 // get duplicate entires.
41 return false;
42#endif
43}
44
45bool ReadProcMaps(std::string* proc_maps) {
46 // seq_file only writes out a page-sized amount on each call. Refer to header

Callers 1

ReadProcMapsFunction · 0.85

Calls 1

findMethod · 0.45

Tested by

no test coverage detected