|
|
@@ -47,13 +47,16 @@ typedef struct dmmstats_s {
|
|
|
uint32_t num_free; /**< Number of free()'s served. */
|
|
|
} dmmstats_t;
|
|
|
|
|
|
+#ifdef WITH_KNOBS
|
|
|
/** A structure to represent tunable parameters of a heap */
|
|
|
typedef struct dmmknobs_s {
|
|
|
float frag_threshold; /**< Fragmentation threshold to enable coalescing
|
|
|
or not. */
|
|
|
uint32_t mem_threshold; /**< Memory size threshold. */
|
|
|
- int32_t max_coalesce_size; /**< Maximum coalesce size; -1 if coalescing
|
|
|
+#ifdef COALESCING
|
|
|
+ size_t max_coalesce_size; /**< Maximum coalesce size; -1 if coalescing
|
|
|
is not supported */
|
|
|
+#endif /* COALESCING */
|
|
|
uint32_t min_split_size; /**< Minimum split size. */
|
|
|
/* FIXME Need to find explanation */
|
|
|
float empty_threshold; /**< Empty Threshold */
|
|
|
@@ -61,6 +64,7 @@ typedef struct dmmknobs_s {
|
|
|
knob_state_t frag_state; /**< The current state of fragmentation. */
|
|
|
knob_state_t foot_state; /**< The current state of footprint. */
|
|
|
} dmmknobs_t;
|
|
|
+#endif /* WITH_KNOBS */
|
|
|
|
|
|
/** A structure to store heap information. */
|
|
|
typedef struct heap_s {
|
|
|
@@ -70,7 +74,9 @@ typedef struct heap_s {
|
|
|
void *rov_ptr; /**< Roving pointer. */
|
|
|
uint64_t num_objects; /**< Number of objects in the heap. */
|
|
|
dmmstats_t dmm_stats; /**< Statistics of the heap. */
|
|
|
+#ifdef WITH_KNOBS
|
|
|
dmmknobs_t dmm_knobs; /**< Tunable parameters of the heap. */
|
|
|
+#endif /* WITH_KNOBS */
|
|
|
#ifdef HAVE_LOCKS
|
|
|
pthread_mutex_t mutex;/**< Mutex when POSIX Threads are used. */
|
|
|
#endif /* HAVE_LOCKS */
|