Skip to content

Commit 421ea7b

Browse files
authored
Merge pull request #105 from struct/caches_into_root
move cache pointers into the root to protect them, run clang-format
2 parents 6b107f4 + e5427e7 commit 421ea7b

2 files changed

Lines changed: 82 additions & 87 deletions

File tree

include/iso_alloc_internal.h

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,9 +448,22 @@ typedef struct iso_alloc_big_zone_t {
448448
* that hold chunks containing caller data */
449449
typedef struct {
450450
uint16_t zones_used;
451-
uint16_t system_page_size;
452451
void *guard_below;
453452
void *guard_above;
453+
uintptr_t *chunk_quarantine;
454+
size_t chunk_quarantine_count;
455+
/* Zones are linked by their next_sz_index member which
456+
* tells the allocator where in the _root->zones array
457+
* it can find the next zone that holds the same size
458+
* chunks. The lookup table helps us find the first zone
459+
* that holds a specific size in O(1) time */
460+
zone_lookup_table_t *zone_lookup_table;
461+
/* The chunk to zone lookup table provides a high hit
462+
* rate cache for finding which zone owns a user chunk.
463+
* It works by mapping the MSB of the chunk addressq
464+
* to a zone index. Misses are gracefully handled and
465+
* more common with a higher RSS and more mappings. */
466+
chunk_lookup_table_t *chunk_lookup_table;
454467
uint64_t zone_handle_mask;
455468
uint64_t big_zone_next_mask;
456469
uint64_t big_zone_canary_secret;

0 commit comments

Comments
 (0)