---
name: "gearman_worker_set_memory_allocators"
section: "3"
platform: "linux"
package: "gearmand"
version: "2.2.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/gearman_worker_set_memory_allocators"
---

# gearman\_worker\_set\_memory\_allocators(3)

Gearmand Documentation, https://gearman.org/gearmand/

## NAME

gearman\_worker\_set\_memory\_allocators - Gearmand Documentation, https://gearman.org/gearmand/

## SYNOPSIS

\#include \<libgearman/gearman.h\>

- **type gearman\_allocator\_t**

  - **type gearman\_malloc\_fn**

  - **type gearman\_free\_fn**

  - **type gearman\_realloc\_fn**

  - **type gearman\_calloc\_fn**

  - ***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)**

  Link to -lgearman

## DESCRIPTION

Install callbacks for custom allocation.

Normally **[malloc(3)](/malloc/3.md)** and **[free(3)](/free/3.md)** are used for allocation and releasing workloads. You can use *gearman\_client\_set\_memory\_allocators()* and *gearman\_worker\_set\_memory\_allocators()* to set your own custom allocators.

## RETURN VALUE

None

**SEE ALSO:**

**[gearmand(8)](/gearmand/8.md)** **[libgearman(3)](/libgearman/3.md)** **[gearman\_client\_st(3)](/gearman_client_st/3.md)**

## AUTHOR

Data Differential http://www.datadifferential.com/

## COPYRIGHT

2011-2014, Data Differential, http://www.datadifferential.com/
