CK_BITMAP_INIT(3)

✨ NAME ✨

ck_bitmap_init β€” bestie, it literally initializes a bitmap πŸ’–

πŸ“š LIBRARY

Concurrency Kit (that's libck, and you link it with -lck) πŸŽ€


🌸 SYNOPSIS 🌸

#include <ck_bitmap.h>

void
ck_bitmap_init(ck_bitmap_t *bitmap, unsigned int n_bits, bool set);

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so picture this: you've got a bitmap, right? And it's just sitting there, uninitialized, giving absolutely nothing. Enter ck_bitmap_init(), our main character πŸ‘‘. It initializes the bitmap that the bitmap pointer is pointing at.

The argument n_bits is how many bits you want stored in the bitmap. Yes bestie, you get to decide. The argument set is the vibe check for your bits β€” it decides whether the values of the bits in bitmap get initialized to 1 or to 0. So like, all-on or all-off, your call πŸ’…

Now here's the part where you gotta pay attention, no cap: it is expected that bitmap points to a contiguous region of memory that contains at least the number of bytes specified by ck_bitmap_size(3). Like, the memory has to actually be there. That's the whole thing. That's the assignment πŸ“


🫢 RETURN VALUES 🫢

This function has no return value. It returns nothing. Void. Empty. It simply does the thing and leaves ✨


πŸ’€ ERRORS πŸ’€

⚠️ Okay so listen. The behavior of ck_bitmap_init() is undefined if bitmap is not a pointer to a region of bytes that's at least ck_bitmap_size(3) long. Undefined. As in, we don't know what happens, and you don't want to find out 😭 Do not do this. Give it the memory it deserves.

🌈 SEE ALSO 🌈

And if you want even more lore, additional information is available at http://concurrencykit.org/ 🧚


Okay that's the whole page bestie, you ate that πŸ’… This was CK_BITMAP_INIT(3), dated April 22, 2012, coming to you from the Concurrency Kit era β€” go forth and initialize responsibly, mwah πŸŽ€βœ¨

πŸ“¦ where this page comes from