qb_rb_chunk_alloc(3)

qb_rb_chunk_alloc3

Allocate space for a chunk of the given size.

Usage

#include <qb/qbrb.h>

void * qb_rb_chunk_alloc(
    qb_ringbuffer_t   *rb,   /* ringbuffer instance */
    size_t             len   /* (in) the size to allocate. */
);

Params

rb ringbuffer instance

len (in) the size to allocate.

Overview

If type == QB_RB_FLAG_OVERWRITE and NULL is returned, memory corruption of the memory file has occurred. The ringbuffer should be destroyed. If type == QB_RB_NORMAL then when there is not enough space it will return NULL.

Return value

pointer to chunk to write to, or NULL (if no space).

Releases

4 releases since Debian 11 (Bullseye); the text changed 3 times.

  1. 11
  2. 12
  3. 13
  4. Arch

From libqb 2.0.10-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.