qlibs:(alloc)

πŸ“¦
version 31 Β· 2 versions
, in alpine 3.24

🌸 qlibs:(alloc) 🌸

hey bestie, welcome to the qlibs:(alloc) manual β€” this is the page for alloc, and we're gonna get you comfy with it πŸ’–

✨ NAME ✨

  • alloc β€” allocate memory 🧠✨

πŸŽ€ SYNTAX πŸŽ€

okay so here's the exact shape of it, no cap:

#include "alloc.h"

char *alloc(new);

void alloc_free(x);

void alloc_re(&x,old,new);

char *x;
unsigned int old;
unsigned int new;

πŸ’« DESCRIPTION πŸ’«

alloc allocates enough space from the heap for new bytes of data, and it's adequately aligned for any data type. new may be 0. alloc returns a pointer to that space. If space is not available, alloc returns 0 and sets errno appropriately. slay. ✨

alloc_free returns space to the heap. bye space πŸ‘‹

alloc_re expands the space allocated to x from old bytes to new bytes. It allocates new space, copies old bytes from the old space to the new space, returns the old space to the heap, and changes x to point to the new space. Then it returns 1. If space is not available, alloc_re returns 0, leaving the old space alone. periodt. πŸ’…

πŸ›‘οΈ CVE-2005-1513 πŸ›‘οΈ

bestie, important: this version of alloc respects limits.h to avoid memory resource exhaustion. that's the whole note, but it matters πŸ’œ

πŸ”— SEE ALSO πŸ”—


byeee 🫢 β€” source/version qlibs:(alloc), page 3 (that's the footer, no date in the original, bestie) 🌈✨

πŸ“¦ where this page comes from