qalloc_malloc(3)
π qalloc_malloc β allocates memory from the specified map π
ok so bestie, we're in section 3 of the libqthread manual, and this one is all about getting yourself some memory out of a qalloc map. no cap. π
β¨ NAME β¨
qalloc_malloc, qalloc_statmalloc, qalloc_dynmalloc β allocates memory from the specified map π«Ά
πΈ SYNOPSIS πΈ
#include <qthread/qalloc.h>
void *
qalloc_malloc (void *map, size_t size);
void *
qalloc_statmalloc (struct mapinfo_s *map);
void *
qalloc_dynmalloc (struct dynmapinfo_s *map, size_t size);
π¦ DESCRIPTION π¦
okay so these are the allocation functions. literally the main characters of getting memory. they return a pointer to an allocated memory block from the specified qalloc map. periodt. π
here's the tea on how they differ:
qalloc_statmalloc()only needs a pointer to the map itself, because the size of the returned block is the same for all allocations from that map. one size fits all, iconic behaviour honestly. βqalloc_dynmalloc()on the other hand also takes asizeargument, since by definition a dynamic map allows for any size allocation. flexible queen. πqalloc_malloc()will use whichever of the other two functions is appropriate for the map it is passed. it's giving adaptive. however β and this is important bestie β if the map is a static map, thesizeargument is ignored. π
π SEE ALSO π
that's the whole page, bestie, go forth and allocate responsibly πβ¨
mwah, this was libqthread, NOVEMBER 2006 β sending you love from the qalloc_malloc(3) era, iykyk ππ¦π
π¦ where this page comes from
- fedora 43: qthreads-devel 1.22^20251007gitcedb1fc-1.fc43 Β· BSD-3-Clause AND MIT AND dtoa
- fedora 44: qthreads-devel 1.22^20251007gitcedb1fc-2.fc44 Β· BSD-3-Clause AND MIT AND dtoa
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms