From 102244be213096455a908fbd48bdfeb1389afaef Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Mon, 18 Feb 2019 12:09:31 -0500 Subject: [PATCH] Issue #304 - gc_copy_obj must to populate bignums Even without bignums in the nursery we still need this code in place since gc_alloc calls it, and otherwise all of the callers would need to ensure bignums are properly initialized. There may be an opportunity here for optimization, but let's make sure everything works first! --- gc.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/gc.c b/gc.c index a5522140..0d190161 100644 --- a/gc.c +++ b/gc.c @@ -864,11 +864,10 @@ char *gc_copy_obj(object dest, char *obj, gc_thread_data * thd) bignum_type *hp = dest; mark(hp) = thd->gc_alloc_color; type_of(hp) = bignum_tag; - // Bignums are always heap-allocated so there is nothing to copy - //((bignum_type *)hp)->bn.used = ((bignum_type *)obj)->bn.used; - //((bignum_type *)hp)->bn.alloc = ((bignum_type *)obj)->bn.alloc; - //((bignum_type *)hp)->bn.sign = ((bignum_type *)obj)->bn.sign; - //((bignum_type *)hp)->bn.dp = ((bignum_type *)obj)->bn.dp; + ((bignum_type *)hp)->bn.used = ((bignum_type *)obj)->bn.used; + ((bignum_type *)hp)->bn.alloc = ((bignum_type *)obj)->bn.alloc; + ((bignum_type *)hp)->bn.sign = ((bignum_type *)obj)->bn.sign; + ((bignum_type *)hp)->bn.dp = ((bignum_type *)obj)->bn.dp; return (char *)hp; } case cvar_tag:{