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