Unified · Split
| @@ -6,8 +6,6 @@ · 5 unmodified lines | ||
| 6 | 6 | #include "print.h" |
| 7 | 7 | #include "table.h" |
| 8 | 8 | |
| 9 | −#define inline_space sizeof(((sl_htable*)nil)->_space) | |
| 10 | − | |
| 11 | 9 | static const sl_type *sl_tabletype; |
| 12 | 10 | |
| 13 | 11 | sl_nonnull(2) |
| @@ -131,7 +129,7 @@ BUILTIN("table", table) · 117 unmodified lines | ||
| 131 | 129 | if(cnt <= HT_N_INLINE) |
| 132 | 130 | nt = cvalue_nofinalizer(sl_tabletype, sizeof(sl_htable)); |
| 133 | 131 | else |
| 134 | − nt = cvalue(sl_tabletype, sizeof(sl_htable)-inline_space); | |
| 132 | + nt = cvalue(sl_tabletype, sl_offsetof(sl_htable, _space)); | |
| 135 | 133 | sl_htable *h = cvalue_data(nt); |
| 136 | 134 | htable_new(h, cnt/2); |
| 137 | 135 | sl_v k = sl_nil, arg; |
| @@ -156,7 +154,7 @@ BUILTIN("put!", put) · 18 unmodified lines | ||
| 156 | 154 | if(table0 == &h->_space[0] && h->table != &h->_space[0]){ |
| 157 | 155 | sl_cv *cv = ptr(sl_cv, args[0]); |
| 158 | 156 | add_finalizer(cv); |
| 159 | − cv->len = sizeof(sl_htable) - inline_space; | |
| 157 | + cv->len = sl_offsetof(sl_htable, _space); | |
| 160 | 158 | } |
| 161 | 159 | return args[0]; |
| 162 | 160 | } |