QB_RB_SPACE_USED(3)

πŸ’– QB_RB_SPACE_USED(3) πŸ’–

okay so bestie, welcome to the libqb Programmer's Manual ✨ this one's a lil baby page but it's IMPORTANT, so lock in 🫢


🌸 NAME 🌸

qb_rb_space_used β€” the total amount of data in the buffer, fr fr πŸ’…


✨ SYNOPSIS ✨

#include <qb/qbrb.h>

ssize_t qb_rb_space_used(
    qb_ringbuffer_t   *rb   /* ringbuffer instance */
);

πŸŽ€ PARAMS πŸŽ€

  • rb β€” ringbuffer instance πŸ’« (yes that's it, that's the whole param list, she's low maintenance)

πŸ‘‘ DESCRIPTION πŸ‘‘

no cap, there's no extra prose here in the original β€” the whole vibe is the note below πŸ‘‡

πŸ’œ NOTE πŸ’œ

this count includes the chunk headers β€” that's 8 bytes per chunk πŸ“ so when you're doing your math, don't forget to account for the headers too, or the vibe check will fail 😭

heads up bestie: qb_rb_space_used is giving total data in the buffer, not free space. if that's what you wanted, you want qb_rb_space_free instead, iykyk πŸ’…

🌈 SEE ALSO 🌈

the whole ringbuffer friend group, periodt πŸ‘‘ go read them all, they ate πŸ’…


Copyright (C) 2010-2020 Red Hat, Inc. β€” slay, thanks Red Hat 🫢


and that's the whole page, bestie!! this one came from LIBQB, dated 2025-09-16, and it lives at QB_RB_SPACE_USED(3) in the manual πŸ’– go forth and count your chunks (headers included, don't forget!!) βœ¨πŸŽ€

πŸ“¦ where this page comes from