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

Method Open

util/system/shmat.cpp:104–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102}
103
104bool TSharedMemory::Open(const TGUID& id, int size) {
105 // Y_ASSERT(Data == 0);
106 Id = id;
107 Size = size;
108
109 char name[100];
110 FormatName(name, Id);
111 Handle = OpenFileMappingA(FILE_MAP_ALL_ACCESS, FALSE, name);
112
113 if (Handle == 0) {
114 return false;
115 }
116
117 Data = MapViewOfFile(Handle, FILE_MAP_ALL_ACCESS, 0, 0, size);
118
119 if (Data == 0) {
120 // Y_ASSERT(0);
121 CloseHandle(Handle);
122 Handle = INVALID_OS_HANDLE;
123
124 return false;
125 }
126
127 return true;
128}
129
130bool TSharedMemory::Create(int size) {
131 // Y_ASSERT(Data == 0);

Callers 1

Y_UNIT_TESTFunction · 0.45

Calls 6

FormatNameFunction · 0.85
GetGuidAsStringFunction · 0.85
shmgetFunction · 0.85
shmatFunction · 0.85
GetKeyFunction · 0.70
dataMethod · 0.45

Tested by

no test coverage detected