limb 0.2.0

2024-01-09

genalloc.h(0)
limb manual
genalloc.h(0)

NAME

genalloc.h - general heap memory management

SYNOPSIS

#include <limb/genalloc.h>

DESCRIPTION

This header defines functions to work heap-allocated memory. It is implemented on top of stralloc (See stralloc.h(0) for more) providing an API to store dynamic arrays of fixed-size objects.

skalibs

This header is a complement to skalibs' own header, intended to be used as a "replacement". However, instead of re-inventing the wheel, it depends/includes skalibs' header, and some of the functions below are actually implemented in skalibs, or macros to such functions.

Types

The following types are defined :

genalloc

A struct stralloc, as genalloc is implemented on top of stralloc

Objects

The following objects are defined :

genalloc_zero

An empty genalloc, which can be used for initialization.

Macros

The following macros are defined :

GENALLOC_ZERO

Value to initialize a stack-allocated genalloc.

Functions

The following functions/macros are defined :

genalloc_ready_tuned(3)

Ensure there's enough space in a genalloc.

genalloc_ready(3)

Ensure there's enough space in a genalloc.

genalloc_readyplus(3)

Ensure there's enough extra space in a genalloc.

genalloc_free(3)

Free memory associated with a genalloc.

genalloc_deepfree(3)

Free memory associated with a genalloc.

genalloc_deepfree_size(3)

Free memory associated with a genalloc.

genalloc_shrink(3)

Reduce memory usage to what's used.

genalloc_s(3)

Return a pointer to the data in a genalloc

genalloc_len(3)

Return the length/number of element in a genalloc

genalloc_setlen(3)

Set the length/number of element in a genalloc

genalloc_copyb(3)

Copy data into a genalloc.

genalloc_copy(3)

Copy content of a genalloc into another one.

genalloc_catb(3)

Append data into a genalloc.

genalloc_cat(3)

Append the content of a genalloc into another one.

genalloc_append(3)

Append a character into a genalloc.

genalloc_insertb(3)

Insert data into a genalloc at a specific offset.

genalloc_insert(3)

Insert the content of a genalloc into another one at a specific offset.

genalloc_qsort_full(3)

Sort a section of a genalloc using qsort(3).

genalloc_qsort_r_full(3)

Similar to genalloc_qsort_full(3) but using qsort_r(3).

genalloc_qsort(3)

Sort a full genalloc using qsort(3).

genalloc_qsort_r(3)

Similar to genalloc_qsort(3) but using qsort_r(3).

genalloc_remove(3)

Remove data from a genalloc.

genalloc_reverse(3)

Reverse the content of a genalloc.

limb 0.1.0
2023-07-24
genalloc.h(0)