CK_BITMAP_SIZE(3)

πŸ’– NAME πŸ’–

ok so bestie, ck_bitmap_size β€” she tells you how many bytes you actually need for your bitmap. that's it, that's the whole job. returns necessary number of bytes for bitmap. slay.


πŸ“š LIBRARY πŸ“š

this one lives in the Concurrency Kit, aka libck, and you link it with -lck. iykyk πŸ’…


✨ SYNOPSIS ✨

#include <ck_bitmap.h>

unsigned int
ck_bitmap_size(unsigned int n_bits);

that's the whole vibe. include the header, call the function, boom. πŸŽ€


🌸 DESCRIPTION 🌸

ok so here's the tea: ck_bitmap_size() returns the number of bytes you need to allocate for a bitmap that's gonna hold the number of bits you specify in n_bits. it's literally just doing the math for you, bestie, so you don't have to.

when you're making bitmap objects dynamically β€” like, at runtime, with malloc energy β€” this is the function you call to figure out how many bytes to grab. 🧚

but listen: the object you allocate still has to be initialized with ck_bitmap_init(3). allocating it is NOT the same as initializing it. do both. no shortcuts. periodt. πŸ”₯

don't skip the init step, bestie, i'm begging 😭

πŸ‘‘ RETURN VALUES πŸ‘‘

this function returns a non-zero value. yes, always non-zero. no cap.


πŸ¦‹ SEE ALSO πŸ¦‹

the whole friend group, in order:

and if you want even more lore, it's all sitting at http://concurrencykit.org/ 🌈


k bye bestie, this page is from way back on April 22, 2012, and it's page CK_BITMAP_SIZE(3) β€” go allocate something iconic πŸ’œβœ¨

πŸ“¦ where this page comes from