Skip to content

Commit

Permalink
Implement deserialize REPR function for P6int and...test cases pass! …
Browse files Browse the repository at this point in the history
…\o/ This means we can successfully serialize a (very simple) object with a cross-ref to an STable in another SC.
  • Loading branch information
jnthn committed Jan 24, 2012
1 parent f4aeff9 commit 0c824b7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/6model/reprs/P6int.c
Expand Up @@ -112,11 +112,16 @@ static storage_spec get_storage_spec(PARROT_INTERP, STable *st) {
return spec;
}

/* Serializes the data into an object. */
/* Serializes the data. */
static void serialize(PARROT_INTERP, STable *st, void *data, SerializationWriter *writer) {
writer->write_int(interp, writer, ((P6intBody *)data)->value);
}

/* Deserializes the data. */
static void deserialize(PARROT_INTERP, STable *st, void *data, SerializationReader *reader) {
((P6intBody *)data)->value = reader->read_int(interp, reader);
}

/* Initializes the P6int representation. */
REPROps * P6int_initialize(PARROT_INTERP) {
/* Allocate and populate the representation function table. */
Expand All @@ -136,5 +141,6 @@ REPROps * P6int_initialize(PARROT_INTERP) {
this_repr->gc_free = gc_free;
this_repr->get_storage_spec = get_storage_spec;
this_repr->serialize = serialize;
this_repr->deserialize = deserialize;
return this_repr;
}

0 comments on commit 0c824b7

Please sign in to comment.