Increase userdata tag size from 8-bit to 16-bit #2289
Unanswered
MrDrElliot
asked this question in
Q&A
Replies: 1 comment
|
I have this currently implement and nothing has blown up yet, it obviously vastly increases memory usage. (Relatively) |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hello!
I'd like to increase the userdata tag from uint8_t (255 tags) to uint16_t (65535 tags).
In Udata:
// Before
// After
This keeps offsetof(Udata, data) == 16, satisfying the existing alignment assert. The tradeoff is len becomes uint16_t, capping userdata size at 65535 bytes, which should be acceptable for my userdata usage.
Are there any footguns with this approach? Specifically:
Are there places in the VM, serializer, or GC that assume tag is 8-bit or len is 32-bit? (beyond the obvious assertions and casts to 8 bit integers scattered about)
Is capping userdata size at 65535 bytes a concern?
Is there a preferred alternative for scaling beyond 255 userdata tags?
Thank you!
All reactions