Skip to content

Commit a5990b0

Browse files
committed
Initial twiddle to handle type objects a bit better during serialization.
1 parent 95a5b70 commit a5990b0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/6model/serialization.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#define HEADER_SIZE 4 * 9
1717
#define DEP_TABLE_ENTRY_SIZE 8
1818
#define STABLE_TABLE_ENTRY_SIZE 8
19-
#define OBJECTS_TABLE_ENTRY_SIZE 12
19+
#define OBJECTS_TABLE_ENTRY_SIZE 16
2020

2121
/* Some guesses. */
2222
#define DEFAULT_STABLE_DATA_SIZE 4096
@@ -262,6 +262,7 @@ static void serialize_object(PARROT_INTERP, SerializationWriter *writer, PMC *ob
262262
write_int32(writer->root.objects_table, offset, sc);
263263
write_int32(writer->root.objects_table, offset + 4, sc_idx);
264264
write_int32(writer->root.objects_table, offset + 8, writer->objects_data_offset);
265+
write_int32(writer->root.objects_table, offset + 12, IS_CONCRETE(obj) ? 1 : 0);
265266

266267
/* Increment count of objects in the table. */
267268
writer->root.num_objects++;
@@ -613,6 +614,8 @@ static void deserialize_object(PARROT_INTERP, SerializationReader *reader, INTVA
613614
/* Delegate to its deserialization REPR function. */
614615
reader->reading_object = 1;
615616
reader->objects_data_offset = read_int32(obj_table_row, 8);
617+
if ((read_int32(obj_table_row, 12) & 1) != 1)
618+
MARK_AS_TYPE_OBJECT(obj);
616619
if (REPR(obj)->deserialize)
617620
REPR(obj)->deserialize(interp, STABLE(obj), OBJECT_BODY(obj), reader);
618621
else

0 commit comments

Comments
 (0)