MCPcopy Create free account
hub / github.com/apache/mesos / writeJemallocSetting

Function writeJemallocSetting

3rdparty/libprocess/src/memory_profiler.cpp:245–265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

243// to return.
244template<typename T>
245Try<Nothing> writeJemallocSetting(const char* name, const T& value)
246{
247#ifdef LIBPROCESS_ALLOW_JEMALLOC
248 if (!detectJemalloc()) {
249 return Error(JEMALLOC_NOT_DETECTED_MESSAGE);
250 }
251
252 int error = mallctl(
253 name, nullptr, nullptr, const_cast<T*>(&value), sizeof(value));
254
255 if (error) {
256 return Error(strings::format(
257 "Couldn't write value %s for option %s: %s",
258 stringify(value), name, ::strerror(error)).get());
259 }
260
261 return Nothing();
262#else
263 UNREACHABLE();
264#endif
265}
266
267
268// All generated disk artifacts, i.e. profiles and graph files, are stored

Callers 1

dumpFunction · 0.85

Calls 7

detectJemallocFunction · 0.85
formatFunction · 0.85
strerrorFunction · 0.85
NothingClass · 0.85
ErrorClass · 0.50
stringifyClass · 0.50
getMethod · 0.45

Tested by

no test coverage detected