summaryrefslogtreecommitdiff
path: root/standalone/combined.h
diff options
context:
space:
mode:
Diffstat (limited to 'standalone/combined.h')
-rw-r--r--standalone/combined.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/standalone/combined.h b/standalone/combined.h
index e8390a7b44f..f49fc9aac84 100644
--- a/standalone/combined.h
+++ b/standalone/combined.h
@@ -32,6 +32,8 @@ extern "C" inline void EmptyCallback() {}
namespace scudo {
+enum class Option { ReleaseInterval };
+
template <class Params, void (*PostInitCallback)(void) = EmptyCallback>
class Allocator {
public:
@@ -624,8 +626,14 @@ public:
return Options.MayReturnNull;
}
- // TODO(kostyak): implement this as a "backend" to mallopt.
- bool setOption(UNUSED uptr Option, UNUSED uptr Value) { return false; }
+ bool setOption(Option O, sptr Value) {
+ if (O == Option::ReleaseInterval) {
+ Primary.setReleaseToOsIntervalMs(static_cast<s32>(Value));
+ Secondary.setReleaseToOsIntervalMs(static_cast<s32>(Value));
+ return true;
+ }
+ return false;
+ }
// Return the usable size for a given chunk. Technically we lie, as we just
// report the actual size of a chunk. This is done to counteract code actively