149 uint64_t extern_offset = key >> 3;
150 uint8_t local_offset = key - extern_offset*8;
152 uint8_t *target = &ba->
array[extern_offset];
155 *target |= get_set_bit_mask[local_offset];
157 *target &= unset_bit_mask[local_offset];
175 uint64_t extern_offset = key >> 3;
176 uint8_t local_offset = key - extern_offset*8;
179 return (ba->
array[extern_offset] & get_set_bit_mask[local_offset]) >> local_offset;
void Bit_Array_dump(struct Bit_Array *ba)
Prints a Bit_Array on standard output.
uint64_t size
The number of uint8_t array contains.
void Bit_Array_release(struct Bit_Array *ba)
Bit_Array deinitializer.
void Bit_Array_init(struct Bit_Array *ba, uint64_t size)
Bit_Array initializer.
uint64_t real_size
The number of bits the array contains.
static uint64_t Bit_Array_size(struct Bit_Array *ba)
Getter on the array size.
static const int get_set_bit_mask[]
Masks used to get and set bits.
static const int unset_bit_mask[]
Masks used to unset bits.
static void Bit_Array_set(struct Bit_Array *ba, uint64_t key, uint8_t value)
Sets a bit in a Bit_Array.
static uint8_t Bit_Array_get(struct Bit_Array *ba, uint64_t key)
Gets a bit in a Bit_Array.
void Bit_Array_replicate(struct Bit_Array *dest, struct Bit_Array *src)
Copies a Bit_Array into another.