mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-23 20:15:05 +02:00
WIP
This commit is contained in:
parent
3be5810662
commit
71adc67d18
2 changed files with 5 additions and 4 deletions
5
gc.c
5
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;
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue