mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00:00
When trying to allocate memory for functions like `Managed.init` and `Managed.set` on the stack, a comptime-known allocation size is desired. The doc comments for these functions indicate that `calcLimbLen` can be used to determine how many limbs to allocate, but if `value` is not comptime-known, then neither is `calcLimbLen(value)`. However, an upper bound on the allocation size is still computable at comptime in this case, so this note documents an expression that can be used, rather than trying to add it to every doc comment that mentions `calcLimbLen`.