Avoid unnecessary call to gc_allocated_bytes

This commit is contained in:
Justin Ethier 2017-06-12 17:57:47 -04:00
parent d02437a0c5
commit 5c1048bfe0

3
gc.c
View file

@ -633,8 +633,7 @@ void *gc_try_alloc(gc_heap * h, int heap_type, size_t size, char *obj,
// Copy object into heap now to avoid any uninitialized memory issues // Copy object into heap now to avoid any uninitialized memory issues
gc_copy_obj(f2, obj, thd); gc_copy_obj(f2, obj, thd);
//h->free_size -= gc_allocated_bytes(obj, NULL, NULL); //h->free_size -= gc_allocated_bytes(obj, NULL, NULL);
ck_pr_sub_ptr(&(thd->cached_heap_free_sizes[heap_type]), ck_pr_sub_ptr(&(thd->cached_heap_free_sizes[heap_type]), size);
gc_allocated_bytes(obj, NULL, NULL));
} else { } else {
ck_pr_add_int(&(thd->heap_num_huge_allocations), 1); ck_pr_add_int(&(thd->heap_num_huge_allocations), 1);
} }