Documentation
¶
Overview ¶
Package allocsize computes the size of an allocation from lengths without wrapping.
Go's make checks a size it is given, but an `a + b` or `2*n + c` that wraps reaches it as a small or negative number: the first allocates too little and the caller then writes past it, the second panics late. These helpers return math.MaxInt for a sum or product that does not fit an int, so make panics ("len out of range"), as it does for any size larger than memory. Operands are lengths and capacities, never negative; a negative operand is treated like an overflow.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.