MCPcopy Create free account
hub / github.com/apache/kvrocks / SetJemallocOption

Function SetJemallocOption

src/server/memory_profiler.cc:32–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30#ifdef ENABLE_JEMALLOC
31template <typename T>
32Status SetJemallocOption(const char *name, T value) {
33 T old_value;
34 size_t old_value_size = sizeof(T);
35 int ret = mallctl(name, &old_value, &old_value_size, reinterpret_cast<void *>(&value), sizeof(T));
36 if (ret != 0) {
37 return {Status::NotOK, fmt::format("unable to set the jemalloc option: {}, error: {}", name, strerror(errno))};
38 }
39 return Status::OK();
40}
41
42template <typename T>
43Status GetJemallocOption(const char *name, T *value) {

Callers 1

SetProfilingMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected