MCPcopy Create free account
hub / github.com/dmtcp/dmtcp / GetProgramPath

Method GetProgramPath

jalib/jfilesystem.cpp:259–269  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

257}
258
259dmtcp::string
260jalib::Filesystem::GetProgramPath()
261{
262 static dmtcp::string *value = NULL;
263 if (value == NULL) {
264 // Technically, this is a memory leak, but value is static and so it happens
265 // only once.
266 value = new (JALLOC_MALLOC(sizeof(dmtcp::string))) dmtcp::string(_GetProgramExe());
267 }
268 return *value;
269}
270
271// NOTE: ResolveSymlink returns a string, buf, allocated on the stack.
272// While this is dangerous, it avoids the use of malloc or 'new'.

Callers

nothing calls this directly

Calls 1

_GetProgramExeFunction · 0.85

Tested by

no test coverage detected