1
0
mirror of https://github.com/janet-lang/janet synced 2025-10-31 15:43:01 +00:00

Begin work on new memory layout for all objects and GC.

The layout should actually be very similar to the old layout, but
the code will be much easier to change and should be more portable.
This commit is contained in:
Calvin Rose
2019-02-21 11:22:29 -05:00
parent 811b1825cb
commit 00a47dc0cb
19 changed files with 196 additions and 145 deletions

View File

@@ -407,7 +407,7 @@ static void marshal_one(MarshalState *st, Janet x, int flags) {
int32_t i, count, flag;
const Janet *tup = janet_unwrap_tuple(x);
count = janet_tuple_length(tup);
flag = janet_tuple_flag(tup);
flag = janet_tuple_flag(tup) >> 16;
pushbyte(st, LB_TUPLE);
pushint(st, count);
pushint(st, flag);
@@ -1042,7 +1042,7 @@ static const uint8_t *unmarshal_one(
/* Tuple */
Janet *tup = janet_tuple_begin(len);
int32_t flag = readint(st, &data);
janet_tuple_flag(tup) = flag;
janet_tuple_flag(tup) |= flag << 16;
for (int32_t i = 0; i < len; i++) {
data = unmarshal_one(st, data, tup + i, flags + 1);
}