Conversation
2621c37 to
8968499
Compare
986bff5 to
bafe96f
Compare
ext/liquid_c/document_body.c
Outdated
| VALUE str = rb_str_buf_new(sizeof(document_body_header_t) + buffer_len + constants_len); | ||
|
|
||
| document_body_header_t header = { | ||
| .entrypoint_block_index = entrypoint_block_index, |
There was a problem hiding this comment.
Should we add a bytecode/serialization version at the top? In case we need to make some backward incompatible changes to the bytecode.
There was a problem hiding this comment.
Yes. I suggested this in the deserialize PR here https://github.com/Shopify/liquid-c/pull/138/files#r551963712
ext/liquid_c/document_body.h
Outdated
| } document_body_t; | ||
|
|
||
| typedef struct document_body_header { | ||
| uint32_t entrypoint_block_index; |
There was a problem hiding this comment.
I see it's called index here, but it ends up being used as an offset here: https://github.com/Shopify/liquid-c/pull/138/files#diff-d25b9c9a1b16f1935c261f8232ea43e790513f022f33b7c8de117016cd76f130R188 correct?
Should this be renamed to _offset or the code is wrong in #138?
There was a problem hiding this comment.
You're right, it is an offset. There isn't currently a block table to index into.
bafe96f to
0e8d1c2
Compare
0e8d1c2 to
f26621c
Compare
Based on #136.
This PR implements
BlockBody#dumpthat dumps the block body to a string. The block body dumps the instructions, writes the tag markups to the buffer, and marshal dumps the constants into a single string that is returned.