From 71adc67d181aed355a35ae032593716dc500f016 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Tue, 21 Sep 2021 17:57:42 -0400 Subject: [PATCH] WIP --- gc.c | 5 +++-- include/cyclone/types.h | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/gc.c b/gc.c index 9c3db61d..8fe8343a 100644 --- a/gc.c +++ b/gc.c @@ -41,7 +41,8 @@ #define gc_word_align(n) gc_align((n), 3) // Align on GC_BLOCK_BITS, currently block size of 32 bytes -#define gc_heap_align(n) gc_align(n, GC_BLOCK_BITS) +#define gc_heap_align(n) gc_word_align(n) +//#define gc_heap_align(n) gc_align(n, GC_BLOCK_BITS) //////////////////// // Global variables @@ -409,7 +410,7 @@ gc_heap *gc_heap_create(int heap_type, size_t size, gc_thread_data *thd) h->last_alloc_size = 0; thd->cached_heap_total_sizes[heap_type] += size; thd->cached_heap_free_sizes[heap_type] += size; - h->data = (char *)gc_heap_align(sizeof(h->data) + (uintptr_t) & (h->data)); + h->data = (char *)gc_align(sizeof(h->data) + (uintptr_t) & (h->data), 5); h->next = NULL; h->num_unswept_children = 0; free = h->free_list = (gc_free_list *) h->data; diff --git a/include/cyclone/types.h b/include/cyclone/types.h index 823f9010..54bb5eab 100644 --- a/include/cyclone/types.h +++ b/include/cyclone/types.h @@ -186,9 +186,9 @@ typedef int gc_heap_type; /** The first heap type that is not fixed-size */ #if INTPTR_MAX == INT64_MAX -#define LAST_FIXED_SIZE_HEAP_TYPE (2 * 4) +#define LAST_FIXED_SIZE_HEAP_TYPE 11 #else -#define LAST_FIXED_SIZE_HEAP_TYPE (1 * 4) +#define LAST_FIXED_SIZE_HEAP_TYPE 7 #endif #define HEAP_REST (LAST_FIXED_SIZE_HEAP_TYPE + 1)