GEARMAN_WORKER...ORY_ALLOCATORS(3)
π NAME π
gearman_worker_set_memory_allocators β Gearmand Documentation, http://gearman.info/
okay bestie, we're deep in the Gearmand man pages (manual name <rainbow>GEARMAN_WORKER...ORY_ALLOCATORS</rainbow>, section 3, the library-calls girly) and this one is all about telling libgearman exactly who's gonna be handling your memory. it's giving "let me do it myself" energy and honestly? iconic. π
β¨ SYNOPSIS β¨
first, you gotta pull in the header, no cap:
#include <libgearman/gearman.h>
then we got the types, our little type-fam:
type gearman_allocator_t
type gearman_malloc_fn
type gearman_free_fn
type gearman_realloc_fn
type gearman_calloc_fn
and then the actual functions, both returning gearman_return_t:
gearman_return_t gearman_client_set_memory_allocators(gearman_client_st*, gearman_malloc_fn *malloc_fn, gearman_free_fn *free_fn, gearman_realloc_fn *realloc_fn, gearman_calloc_fn *calloc_fn, void *context)
gearman_return_t gearman_worker_set_memory_allocators(gearman_worker_st*, gearman_malloc_fn *malloc_fn, gearman_free_fn *free_fn, gearman_realloc_fn *realloc_fn, gearman_calloc_fn *calloc_fn, void *context)
and hello?? don't forget to link the girl:
Link to -lgearman
like, <hotpink>link to -lgearman</hotpink> or she simply will not show up. π«Ά
πΈ DESCRIPTION πΈ
so true story: this function installs callbacks for custom allocation. that's the whole vibe. π
normally, malloc(3) and free(3) are the ones doing all the work β allocating and releasing workloads, being the main characters. but you can absolutely take the aux cord and use gearman_client_set_memory_allocators() and gearman_worker_set_memory_allocators() to set your own custom allocators. your memory, your rules. no cap. π₯
π RETURN VALUE π
None
girl... it just says None. that's it. that's the whole sentence. not me getting zero crumbs of info on the return value. π
See also: gearmand(8) libgearman(3) gearman_client_st(3)
π§ Author π§
Data Differential http://www.datadifferential.com/
π Copyright π
2011-2014, Data Differential, http://www.datadifferential.com/
and that's the whole page bestie, we ate and left no crumbs β¨ β this lil' doc is from version 1.1.21+ds, dated Feb 04, 2024, and it came to you straight from the Gearmand source. mwah, go write a custom allocator, i believe in you π¦πΈπ
π¦ where this page comes from
- ubuntu resolute: libgearman-dev 1.1.21+ds-1ubuntu3 Β· BSD-3-Clause
- ubuntu stonking: libgearman-dev 1.1.21+ds-1ubuntu3 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms