Skip to content

Fix some Factory/ext_type optimization edge cases - #400

Merged
byroot merged 1 commit into
msgpack:masterfrom
Shopify:hm-nvplsywlxruxzzmx
Aug 6, 2026
Merged

Fix some Factory/ext_type optimization edge cases#400
byroot merged 1 commit into
msgpack:masterfrom
Shopify:hm-nvplsywlxruxzzmx

Conversation

@hmcguire-shopify

Copy link
Copy Markdown

Previously, optimized_symbol_parsing would enable a fast path for symbols but it never actually registered the Symbol's ext_type (so it was always 0x0). This resulted in the optimization not working if Symbol is registered with a different type and could additionally cause data corruption if some other type is registered as 0x0.

Additionally, many of these Factory fields were not copied over on dup, meaning pooled Factories would have optimized_symbol_parsing disabled if they don't explicitly freeze before calling pool (which would do dup.freeze).

Previously, optimized_symbol_parsing would enable a fast path for
symbols but it never actually registered the Symbol's ext_type (so it
was always 0x0). This resulted in the optimization not working if Symbol
is registered with a different type and could additionally cause data
corruption if some other type is registered as 0x0.

Additionally, many of these Factory fields were not copied over on dup,
meaning pooled Factories would have optimized_symbol_parsing disabled if
they don't explicitly `freeze` before calling `pool` (which would do
`dup.freeze`).
@byroot
byroot merged commit 64fca29 into msgpack:master Aug 6, 2026
19 checks passed
@hmcguire-shopify
hmcguire-shopify deleted the hm-nvplsywlxruxzzmx branch August 6, 2026 15:04
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

Successfully merging this pull request may close these issues.

3 participants