mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-23 13:13:06 +00:00
HPA: Introduce a redesigned hpa_central_t.
For now, this only handles allocating virtual address space to shards, with no reuse. This is framework, though; it will change over time.
This commit is contained in:
committed by
David Goldblatt
parent
e09eac1d4e
commit
d93eef2f40
@@ -40,6 +40,7 @@ init_test_extent_hooks(extent_hooks_t *hooks) {
|
||||
typedef struct test_data_s test_data_t;
|
||||
struct test_data_s {
|
||||
pa_shard_t shard;
|
||||
pa_central_t central;
|
||||
base_t *base;
|
||||
emap_t emap;
|
||||
pa_shard_stats_t stats;
|
||||
@@ -63,9 +64,13 @@ test_data_t *init_test_data(ssize_t dirty_decay_ms, ssize_t muzzy_decay_ms) {
|
||||
nstime_t time;
|
||||
nstime_init(&time, 0);
|
||||
|
||||
err = pa_central_init(&test_data->central, base, opt_hpa,
|
||||
&hpa_hooks_default);
|
||||
assert_false(err, "");
|
||||
|
||||
const size_t oversize_threshold = 8 * 1024 * 1024;
|
||||
err = pa_shard_init(TSDN_NULL, &test_data->shard, &test_data->emap,
|
||||
test_data->base, /* ind */ 1, &test_data->stats,
|
||||
err = pa_shard_init(TSDN_NULL, &test_data->shard, &test_data->central,
|
||||
&test_data->emap, test_data->base, /* ind */ 1, &test_data->stats,
|
||||
&test_data->stats_mtx, &time, oversize_threshold, dirty_decay_ms,
|
||||
muzzy_decay_ms);
|
||||
assert_false(err, "");
|
||||
|
||||
Reference in New Issue
Block a user