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