LIBXO(3)

πŸ“¦
version 1.7.5 Β· 2 versions
, in epel 9, fedora 43, fedora 44, nixpkgs unstable

πŸ’… LIBXO(3) β€” Library Functions Manual

okay bestie, gather round, because today we're talking about libxo(3) β€” yes, that libxo β€” and specifically one lil' function that lets it vibe in places where the usual memory crew can't show up. 🫢


✨ NAME ✨

xo_set_allocator β€” set allocation functions for libxo

πŸ“š LIBRARY πŸ“š

library β€œlibxo”

πŸŽ€ SYNOPSIS πŸŽ€

#include <libxo/xo.h>
typedef void *(*xo_realloc_func_t)(void *, size_t);

typedef void (*xo_free_func_t)(void *);

void
xo_set_allocator(xo_realloc_func_t realloc_func,
    xo_free_func_t free_func);

🌸 DESCRIPTION 🌸

so like. xo_set_allocator() is the function that lets libxo exist in environments where the standard realloc(3) and free(3) functions simply are not available. imagine showing up to a party and the DJ isn't there β€” you gotta bring your own, fr fr. 🎧

realloc_func should expect the same arguments as realloc(3) and return a pointer to memory following the same convention. no cap, same energy.

free_func will receive the same argument as free(3) and should release it, as appropriate for the environment. do your thing, bestie, just make sure it's actually your thing. πŸ’…

By default, the standard realloc(3) and free(3) functions are used. so if you don't call this, everything just... works. iconic behavior honestly. ✨

πŸ‘€ SEE ALSO πŸ‘€

πŸ“œ HISTORY πŸ“œ

The libxo library first appeared in FreeBSD 11.0. a whole era. πŸ¦‹

πŸ‘‘ AUTHORS πŸ‘‘

libxo was written by Phil Shafer <phil@freebsd.org>. we stan. πŸ’–

πŸ“ ADDITIONAL DOCUMENTATION πŸ“

FreeBSD uses libxo version 1.7.5. Complete documentation can be found on github:

https://juniper.github.io/libxo/1.7.5/html/index.html

libxo lives on github as:

https://github.com/Juniper/libxo

The latest release of libxo is available at:

https://github.com/Juniper/libxo/releases

πŸ“– HISTORY πŸ“–

The libxo library was added in FreeBSD 11.0. (yes, this section said basically the same thing earlier β€” the manpage said it twice so we're saying it twice. consistency queen. πŸ‘‘)

✍️ AUTHOR ✍️

Phil Shafer


quick vibe check bestie: if you're not in a weird embedded-ish environment with no realloc(3)/free(3), you probably don't need to touch this at all. the defaults are defaulting. leave them be. πŸ™ˆ

and that's the whole page, fr fr β€” this was libxo(3) from the Debian crew, dated December 4, 2014. mwah, go forth and allocate responsibly. πŸ’œπŸ§š

πŸ“¦ where this page comes from