aboutsummaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
Diffstat (limited to 'config.c')
-rw-r--r--config.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/config.c b/config.c
index da723e97..b33f5818 100644
--- a/config.c
+++ b/config.c
@@ -22,6 +22,7 @@
#include "wayland.h"
#define ALEN(v) (sizeof(v) / sizeof(v[0]))
+#define min(x, y) ((x) < (y) ? (x) : (y))
static const uint32_t default_foreground = 0xdcdccc;
static const uint32_t default_background = 0x111111;
@@ -636,6 +637,18 @@ parse_section_tweak(
LOG_WARN("tweak: delayed-render-upper=%lu", ns);
}
+ else if (strcmp(key, "max-shm-pool-size-mb") == 0) {
+ unsigned long mb;
+ if (!str_to_ulong(value, 10, &mb)) {
+ LOG_ERR("%s:%d: expected an integer: %s", path, lineno, value);
+ return false;
+ }
+
+ conf->tweak.max_shm_pool_size = min(mb * 1024 * 1024, INT32_MAX);
+ LOG_WARN("tweak: max-shm-pool-size=%lu bytes",
+ conf->tweak.max_shm_pool_size);
+ }
+
else {
LOG_ERR("%s:%u: invalid key: %s", path, lineno, key);
return false;
@@ -906,6 +919,7 @@ config_load(struct config *conf, const char *conf_path)
.tweak = {
.delayed_render_lower_ns = 500000, /* 0.5ms */
.delayed_render_upper_ns = 16666666 / 2, /* half a frame period (60Hz) */
+ .max_shm_pool_size = 512 * 1024 * 1024,
},
};