| 30 | #ifdef ENABLE_JEMALLOC |
| 31 | template <typename T> |
| 32 | Status 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 | |
| 42 | template <typename T> |
| 43 | Status GetJemallocOption(const char *name, T *value) { |