IXP_EMALLOC(3)

πŸ“¦ version 0-unstable-2022-04, in nixos 26.05, nixpkgs unstable

πŸ’– IXP_EMALLOC(3) πŸ’–

okay so bestie, welcome to the libixp Manual β€” this is the Library Functions Manual page for the ixp allocation girlies ✨ and honestly? they're giving "malloc but with consequences" and I'm obsessed 🫢


🌸 NAME 🌸

ixp_emalloc, ixp_emallocz, ixp_erealloc, ixp_estrdup β€” the four besties of memory allocation πŸ’…


✨ SYNOPSIS ✨

#include <ixp.h>
void *ixp_emalloc(uint size);
void *ixp_emallocz(uint size);
void *ixp_erealloc(void *ptr, uint size);
char *ixp_estrdup(const char *str);

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the vibe: these functions act exactly like their stdlib counterparts, no cap β€” same energy, same job. BUT the difference is the main character twist πŸ’€ if allocation fails, they print an error message and exit the program. Like, they don't just quietly return NULL and let you figure it out β€” they said "not today" and ended the whole program. periodt.

And one more thing, iykyk: ixp_emallocz acts like ixp_emalloc but additionally zeros the result of the allocation β€” so you get your memory and a clean slate πŸŽ€βœ¨

fr fr, remember: failure here = error message + exit. no surviving that one 😭

okay bye bestie, go allocate responsibly πŸ’œ β€” this cutie page came from the libixp Manual, dated 2012 Dec, and it's lowkey iconic 🌈⭐

πŸ“¦ where this page comes from