diff --git a/gc.c b/gc.c index a51b19ed..07024c7b 100644 --- a/gc.c +++ b/gc.c @@ -1357,28 +1357,28 @@ void *gc_alloc(gc_heap_root * hrt, size_t size, char *obj, gc_thread_data * thd, size = gc_heap_align(size); if (size <= 32) { heap_type = HEAP_SM; - try_alloc = &gc_try_alloc; - try_alloc_slow = &gc_try_alloc_slow; + //try_alloc = &gc_try_alloc; + //try_alloc_slow = &gc_try_alloc_slow; // TODO: - //try_alloc = &gc_try_alloc_fixed_size; - //try_alloc_slow = &gc_try_alloc_slow_fixed_size; + try_alloc = &gc_try_alloc_fixed_size; + try_alloc_slow = &gc_try_alloc_slow_fixed_size; } else if (size <= 64) { heap_type = HEAP_64; - try_alloc = &gc_try_alloc; - try_alloc_slow = &gc_try_alloc_slow; + //try_alloc = &gc_try_alloc; + //try_alloc_slow = &gc_try_alloc_slow; // TODO: - //try_alloc = &gc_try_alloc_fixed_size; - //try_alloc_slow = &gc_try_alloc_slow_fixed_size; + try_alloc = &gc_try_alloc_fixed_size; + try_alloc_slow = &gc_try_alloc_slow_fixed_size; // Only use this heap on 64-bit platforms, where larger objs are used more often // Code from http://stackoverflow.com/a/32717129/101258 #if INTPTR_MAX == INT64_MAX } else if (size <= 96) { heap_type = HEAP_96; - try_alloc = &gc_try_alloc; - try_alloc_slow = &gc_try_alloc_slow; + //try_alloc = &gc_try_alloc; + //try_alloc_slow = &gc_try_alloc_slow; // TODO: - //try_alloc = &gc_try_alloc_fixed_size; - //try_alloc_slow = &gc_try_alloc_slow_fixed_size; + try_alloc = &gc_try_alloc_fixed_size; + try_alloc_slow = &gc_try_alloc_slow_fixed_size; #endif } else if (size >= MAX_STACK_OBJ) { heap_type = HEAP_HUGE; diff --git a/include/cyclone/types.h b/include/cyclone/types.h index 85d3609e..903620b1 100644 --- a/include/cyclone/types.h +++ b/include/cyclone/types.h @@ -172,12 +172,12 @@ typedef enum { /** The first heap type that is not fixed-size */ // TODO: disable this for now -#define LAST_FIXED_SIZE_HEAP_TYPE -1 -//#if INTPTR_MAX == INT64_MAX -//#define LAST_FIXED_SIZE_HEAP_TYPE HEAP_96 -//#else -//#define LAST_FIXED_SIZE_HEAP_TYPE HEAP_64 -//#endif +//#define LAST_FIXED_SIZE_HEAP_TYPE -1 +#if INTPTR_MAX == INT64_MAX +#define LAST_FIXED_SIZE_HEAP_TYPE HEAP_96 +#else +#define LAST_FIXED_SIZE_HEAP_TYPE HEAP_64 +#endif /** The number of `gc_heap_type`'s */ #define NUM_HEAP_TYPES (HEAP_HUGE + 1)