Skip to content

IntReserve

Description

Ensure value can hold at least capacity bits without reallocating.

Success

Returns true; the magnitude’s capacity is at least capacity.

Failure

Returns false on allocator OOM; value is left unchanged.

Usage example (Cross-references)

Usage examples (Cross-references)
        Int remainder     = IntInit(alloc);
    
        if (!int_try_from_u64(&chunk_divisor, chunk, alloc) || !IntReserve(&quotient, IntBitLength(value))) {
            IntDeinit(&chunk_divisor);
            IntDeinit(&quotient);
Last updated on