Showing the changes to src (3 of 4 files). Show all
Unified · Split
| @@ -13,7 +13,7 @@ enum { · 12 unmodified lines | ||
| 13 | 13 | |
| 14 | 14 | #define LOG2_10 3.321928094887362347870319429489 |
| 15 | 15 | |
| 16 | −#define cons_index(c) (ptr(sl_cons, c)-(sl_cons*)slvm.fromspace) | |
| 16 | +#define cons_index(c) (ptr(sl_aligned, c)-(sl_aligned*)slvm.fromspace) | |
| 17 | 17 | #define ismarked(c) bitvector_get(sl.consflags, cons_index(c)) |
| 18 | 18 | #define mark_cons(c) bitvector_set(sl.consflags, cons_index(c)) |
| 19 | 19 | #define unmark_cons(c) bitvector_reset(sl.consflags, cons_index(c)) |
| @@ -1094,7 +1094,7 @@ sl_print(sl_v v) · 1074 unmodified lines | ||
| 1094 | 1094 | if(iscons(v) || isvec(v) || isfn(v) || (iscvalue(v) && !isstr(v))){ |
| 1095 | 1095 | htable_reset(&sl.pr.conses, HT_N_INLINE); |
| 1096 | 1096 | if(sl.pr.circle) |
| 1097 | − memset(sl.consflags, 0, sizeof(u32int)*bitvector_nwords(slvm.heapsize/sizeof(sl_cons))); | |
| 1097 | + memset(sl.consflags, 0, sizeof(u32int)*bitvector_nwords(slvm.heapsize/sizeof(sl_aligned))); | |
| 1098 | 1098 | } |
| 1099 | 1099 | } |
| 1100 | 1100 | |
| @@ -614,7 +614,7 @@ sl_gc(bool mustgrow) · 613 unmodified lines | ||
| 614 | 614 | cthrow(raise(sl_erroom), mustgrow); |
| 615 | 615 | } |
| 616 | 616 | if(slvm.grew){ |
| 617 | − u64int sz = slvm.heapsize/sizeof(sl_cons); | |
| 617 | + u64int sz = slvm.heapsize/sizeof(sl_aligned); | |
| 618 | 618 | if(sl_unlikely(sz < 1)) |
| 619 | 619 | sz = 1; |
| 620 | 620 | temp = bitvector_resize(sl.consflags, sz, sz*2); |
| @@ -1401,7 +1401,7 @@ failed: · 780 unmodified lines | ||
| 1401 | 1401 | if((slvm.gchandles = MEM_ALLOC(slvm.maxgchandles * sizeof(sl_v*))) == nil) |
| 1402 | 1402 | goto failed; |
| 1403 | 1403 | |
| 1404 | − if((sl.consflags = bitvector_new(slvm.heapsize/sizeof(sl_cons))) == nil) | |
| 1404 | + if((sl.consflags = bitvector_new(slvm.heapsize/sizeof(sl_aligned))) == nil) | |
| 1405 | 1405 | goto failed; |
| 1406 | 1406 | if((htable_new(&sl.pr.conses, HT_N_INLINE)) == nil) |
| 1407 | 1407 | goto failed; |
| @@ -5,6 +5,9 @@ · 4 unmodified lines | ||
| 5 | 5 | #include "htable_h.h" |
| 6 | 6 | HTPROT(ptrhash) |
| 7 | 7 | |
| 8 | +// all allocations on the heap are 8-byte aligned | |
| 9 | +typedef u64int sl_aligned; | |
| 10 | + | |
| 8 | 11 | #if defined(BITS64) |
| 9 | 12 | #define FIXNUM_BITS (64-TAG_BITS) |
| 10 | 13 | #define UNBOXED_BITS (64-TAG_EXT_BITS) |