From 5c1048bfe0891197048aead1b6cac7049c0033b3 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Mon, 12 Jun 2017 17:57:47 -0400 Subject: [PATCH] Avoid unnecessary call to gc_allocated_bytes --- gc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gc.c b/gc.c index 123c10d8..0491d66f 100644 --- a/gc.c +++ b/gc.c @@ -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 gc_copy_obj(f2, obj, thd); //h->free_size -= gc_allocated_bytes(obj, NULL, NULL); - ck_pr_sub_ptr(&(thd->cached_heap_free_sizes[heap_type]), - gc_allocated_bytes(obj, NULL, NULL)); + ck_pr_sub_ptr(&(thd->cached_heap_free_sizes[heap_type]), size); } else { ck_pr_add_int(&(thd->heap_num_huge_allocations), 1); }