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!
This commit is contained in:
Justin Ethier 2019-02-18 12:09:31 -05:00
parent b2b10ca729
commit 102244be21

9
gc.c
View file

@ -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:{