Skip to content

Commit 09bf632

Browse files
committed
Do just enough to make sure serializing modules that declare something with the CStruct REPR should not go awry.
1 parent ac3e430 commit 09bf632

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/6model/reprs/CStruct.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,18 @@ static storage_spec get_storage_spec(PARROT_INTERP, STable *st) {
477477
return spec;
478478
}
479479

480+
/* Serializes the REPR data. */
481+
static void serialize_repr_data(PARROT_INTERP, STable *st, SerializationWriter *writer) {
482+
CStructREPRData *repr_data = (CStructREPRData *)st->REPR_data;
483+
/* Could do this, but can also re-compute it each time for now. */
484+
}
485+
486+
/* Deserializes the REPR data. */
487+
static void deserialize_repr_data(PARROT_INTERP, STable *st, SerializationReader *reader) {
488+
/* Just allocating it will do for now. */
489+
st->REPR_data = mem_sys_allocate_zeroed(sizeof(CStructREPRData));
490+
}
491+
480492
/* Initializes the CStruct representation. */
481493
REPROps * CStruct_initialize(PARROT_INTERP,
482494
PMC * (* wrap_object_func_ptr) (PARROT_INTERP, void *obj),
@@ -502,5 +514,7 @@ REPROps * CStruct_initialize(PARROT_INTERP,
502514
this_repr->gc_free = gc_free;
503515
this_repr->gc_cleanup = gc_cleanup;
504516
this_repr->get_storage_spec = get_storage_spec;
517+
this_repr->serialize_repr_data = serialize_repr_data;
518+
this_repr->deserialize_repr_data = deserialize_repr_data;
505519
return this_repr;
506520
}

0 commit comments

Comments
 (0)