Application Programming Interface for ArrayAllocators.ByteCalculators
ArrayAllocators.ByteCalculators — ModuleArrayAllocators.ByteCalculatorsDefines calculators for computing the number of bytes needed to allocate an array while detecting integer overflow.
Examples
using ArrayAllocators.ByteCalculators
bc = CheckedMulByteCalculator{UInt8}(1024, 2048)
elsize(bc)
nbytes(bc)Default Byte Calculator
ArrayAllocators.ByteCalculators.CheckedMulByteCalculator — TypeCheckedMulByteCalculatorCalculate the number of bytes by using Base.checked_mul to check if the product of the dimensions (length) or the product of the length and the element size will cause an integer overflow.
Alternative Byte Calculators
ArrayAllocators.ByteCalculators.WideningByteCalculator — TypeWideningByteCalculatorWidens eltype(Dims), Int in order to catch integer overflow.
ArrayAllocators.ByteCalculators.UnsafeByteCalculator — TypeUnsafeByteCalculatorCalculate number of bytes to allocate for an array without any integer overflow checking.
SafeByteCalculators.SafeByteCalculators — ModuleSafeByteCalculatorsExtension of ArrayAllocators.ByteCalculators using SaferIntegers.jl.
SafeByteCalculators.SafeByteCalculator — TypeSafeByteCalculatorUse SafeInt from SaferIntegers.jl to calculate the number of bytes to allocate for an Array.
Abstract Type
ArrayAllocators.ByteCalculators.AbstractByteCalculator — TypeAbstractByteCalculatorParent abstract type for byte calculators, which calculate the total number of bytes of memory to allocate.