Showing the changes to src/sl.h (1 of 1 file). Show all
Unified · Split
| @@ -153,9 +153,9 @@ extern sl_v unboxedtypesyms[T_UNBOXED_NUM]; · 152 unmodified lines | |||
| 153 | *(sl_v*)ptr(v) = (sl_v)(to) | FWD_BIT; \ | 153 | *(sl_v*)ptr(v) = (sl_v)(to) | FWD_BIT; \ |
| 154 | }while(0) | 154 | }while(0) |
| 155 | 155 | ||
| 156 | #define vec_size(v) (((usize*)ptr(v))[0]>>TAG_BITS) | ||
| 157 | #define vec_setsize(v, n) (((usize*)ptr(v))[0] = ((n)<<TAG_BITS)) | ||
| 158 | #define vec_elt(v, i) (((sl_v*)ptr(v))[1+(i)]) | 156 | #define vec_elt(v, i) (((sl_v*)ptr(v))[1+(i)]) |
| 157 | #define vec_size(v) uintval(vec_elt((v), -1)) | ||
| 158 | #define vec_setsize(v, n) do{ vec_elt((v), -1) = fixnum(n); }while(0) | ||
| 159 | #define vec_grow_amt(x) ((x)<8 ? 5 : 6*((x)>>3)) | 159 | #define vec_grow_amt(x) ((x)<8 ? 5 : 6*((x)>>3)) |
| 160 | // functions ending in _ are unsafe, faster versions | 160 | // functions ending in _ are unsafe, faster versions |
| 161 | #define car_(v) (((sl_cons*)ptr(v))->car) | 161 | #define car_(v) (((sl_cons*)ptr(v))->car) |