Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile nested block bodies into their parent block body object #78

Closed
dylanahsmith opened this issue Oct 8, 2020 · 1 comment
Closed

Comments

@dylanahsmith
Copy link
Contributor

Currently, the library writes liquid VM code into separate growable buffers (in vm_assembler_t) for each Liquid::C::BlockBody object. However, for block body serialization and deserialization (#77) we will want to share an immutable memory allocation across block bodies, so block bodies will need offsets into that shared memory for execution.

Since block bodies will be connected in this way for execution, we may also want to make parsing more efficient by re-using a vm_assembler_t for a block body once that block body has finished being compiled (e.g. when its parent block tag is finished compiling), by not embedding it in the block_body_t struct. That way we could save on the number of memory allocations for these vm_assembler_t buffers and will have less vm_assembler_t buffers to combine at the end of parsing / compilation. For instance, we could have one vm_assembler_t per-level of nesting in the template.

@dylanahsmith
Copy link
Contributor Author

I think this was fixed in #102

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant