From 8566df11b29a4568a1ee4c70de9a50fab8429b0f Mon Sep 17 00:00:00 2001 From: Arran Cudbard-Bell Date: Sun, 2 Apr 2023 20:11:43 -0600 Subject: [PATCH] Add CONF_PARSER snippet for slabs --- src/lib/util/slab.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/lib/util/slab.h b/src/lib/util/slab.h index 2ed7634526..0da8627f1a 100644 --- a/src/lib/util/slab.h +++ b/src/lib/util/slab.h @@ -30,6 +30,13 @@ extern "C" { #include #include +/** CONF_PARSER entries to populate user configurable slab values + */ +#define FR_SLAB_CONFIG_CONF_PARSER \ + { FR_CONF_OFFSET("min", FR_TYPE_UINT32, fr_slab_config_t, min_elements), .dflt = "10" }, \ + { FR_CONF_OFFSET("max", FR_TYPE_UINT32, fr_slab_config_t, max_elements), .dflt = "100" }, \ + { FR_CONF_OFFSET("cleanup_interval", FR_TYPE_TIME_DELTA, fr_slab_config_t, interval), .dflt = "30s" }, \ + /** Tuneable parameters for slabs */ typedef struct { \ @@ -38,7 +45,7 @@ typedef struct { \ unsigned int max_elements; //!< Maximum number of elements to allocate using slabs. bool at_max_fail; //!< Should requests for additional elements fail when the ///< number in use has reached max_elements. - size_t num_children; //!< How many child allocations are expected off each element. + unsigned int num_children; //!< How many child allocations are expected off each element. size_t child_pool_size; //!< Size of pool space to be allocated to each element. fr_time_delta_t interval; //!< Interval between slab cleanup events being fired. } fr_slab_config_t; -- 2.47.2