qalloc_malloc(3)

πŸ“¦ version 1.22^20251007gitcedb1fc, in fedora 43, fedora 44

πŸ’– 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 a size argument, 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, the size argument 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