Method Oversize
Oversize(Int32, Int32)
Returns an array size >= minTargetSize
, generally
over-allocating exponentially to achieve amortized
linear-time cost as the array grows.
NOTE: this was originally borrowed from Python 2.4.2 listobject.c sources (attribution in LICENSE.txt), but has now been substantially changed based on discussions from java-dev thread with subject "Dynamic array reallocation algorithms", started on Jan 12 2010.
@lucene.internal
Declaration
public static int Oversize(int minTargetSize, int bytesPerElement)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | minTargetSize | Minimum required value to be returned. |
System.Int32 | bytesPerElement | Bytes used by each element of the array. See constants in RamUsageEstimator. |
Returns
Type | Description |
---|---|
System.Int32 |