BitVecByteSize

Table of Contents

BitVecByteSize

Description

Get u64 of bitvector in bytes. This returns the actual memory used by the bit data.

Parameters

NameDirectionDescription
bvinBitvector to get byte u64 of

Usage example (from documentation)

  u64 bytes_used = BitVecByteSize(&flags);

Usage example (Cross-references)

    result = result && (BitVecCapacity(&bv) == 0);
    result = result && BitVecEmpty(&bv);
    result = result && (BitVecByteSize(&bv) == 0);
    
    // Add bits and test macros again
    result = result && (BitVecCapacity(&bv) >= 65);
    result = result && !BitVecEmpty(&bv);
    result = result && (BitVecByteSize(&bv) >= 9); // At least 9 bytes for 65 bits
    
    // Test with exactly power-of-2 sizes
    
    result = result && (BitVecLen(&bv) == 64);
    result = result && (BitVecByteSize(&bv) >= 8); // At least 8 bytes for 64 bits
    
    BitVecDeinit(&bv);

Share :

Related Posts

BitVecCapacity

BitVecCapacity Description Get capacity of bitvector in bits.

Read More

IterSize

IterSize Description Get total size of this Iter object

Read More

BitVecShrinkToFit

BitVecShrinkToFit Description Reduce bitvector capacity to match its current length. Frees any unused memory allocated beyond the current length.

Read More