Extents: Break extent-struct/arena interactions

Specifically, the extent_arena_[g|s]et functions and the address randomization.

These are the only things that tie the extent struct itself to the arena code.
This commit is contained in:
David T. Goldblatt
2019-09-20 18:20:22 -07:00
committed by David Goldblatt
parent 529cfe2abc
commit 41187bdfb0
9 changed files with 106 additions and 83 deletions

View File

@@ -1,5 +1,7 @@
#include "test/jemalloc_test.h"
#define INVALID_ARENA_IND ((1U << MALLOCX_ARENA_BITS) - 1)
TEST_BEGIN(test_arena_slab_regind) {
szind_t binind;
@@ -7,8 +9,9 @@ TEST_BEGIN(test_arena_slab_regind) {
size_t regind;
extent_t slab;
const bin_info_t *bin_info = &bin_infos[binind];
extent_init(&slab, NULL, mallocx(bin_info->slab_size,
MALLOCX_LG_ALIGN(LG_PAGE)), bin_info->slab_size, true,
extent_init(&slab, INVALID_ARENA_IND,
mallocx(bin_info->slab_size, MALLOCX_LG_ALIGN(LG_PAGE)),
bin_info->slab_size, true,
binind, 0, extent_state_active, false, true, true,
EXTENT_NOT_HEAD);
assert_ptr_not_null(extent_addr_get(&slab),