MCPcopy Create free account
hub / github.com/catboost/catboost / ModeToString

Function ModeToString

util/system/protect.cpp:16–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14#endif
15
16static TString ModeToString(const EProtectMemory mode) {
17 TString strMode;
18 if (mode == PM_NONE) {
19 return "PM_NONE";
20 }
21
22 if (mode & PM_READ) {
23 strMode += "PM_READ|";
24 }
25 if (mode & PM_WRITE) {
26 strMode += "PM_WRITE|";
27 }
28 if (mode & PM_EXEC) {
29 strMode += "PM_EXEC|";
30 }
31 return strMode.substr(0, strMode.size() - 1);
32}
33
34void ProtectMemory(void* addr, const size_t length, const EProtectMemory mode) {
35 Y_ABORT_UNLESS(!(mode & ~(PM_READ | PM_WRITE | PM_EXEC)), "Invalid memory protection flag combination. ");

Callers 1

ProtectMemoryFunction · 0.85

Calls 2

substrMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected