You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For things like ring buffers, it's useful to be able to make a reservation based on the maximum size of a type you're serialising. At the moment, we can calculate this at runtime based on an actual value, but this requires us to walk the type twice (but does have the benefit of always being correct for that value).
I wonder if we can instead calculate the maximum size for a T in the proc macro, and then expose it as a constant item on the type? Secondly, would performance of the proc macro suffer from this (if it is not good to do for every type, can we expose some sort of control on the proc macro to only do this for types we care about?)
The text was updated successfully, but these errors were encountered:
For things like ring buffers, it's useful to be able to make a reservation based on the maximum size of a type you're serialising. At the moment, we can calculate this at runtime based on an actual value, but this requires us to walk the type twice (but does have the benefit of always being correct for that value).
I wonder if we can instead calculate the maximum size for a
T
in the proc macro, and then expose it as a constant item on the type? Secondly, would performance of the proc macro suffer from this (if it is not good to do for every type, can we expose some sort of control on the proc macro to only do this for types we care about?)The text was updated successfully, but these errors were encountered: