gearman_allocator_t.rst 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. ================================================
  2. Defining custom allocators (gearman_allocator_t)
  3. ================================================
  4. --------
  5. SYNOPSIS
  6. --------
  7. #include <libgearman/gearman.h>
  8. .. c:type:: gearman_allocator_t
  9. .. c:type:: gearman_malloc_fn
  10. .. c:type:: gearman_free_fn
  11. .. c:type:: gearman_realloc_fn
  12. .. c:type:: gearman_calloc_fn
  13. .. c:function:: 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)
  14. .. c:function:: 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)
  15. Link to -lgearman
  16. -----------
  17. DESCRIPTION
  18. -----------
  19. Install callbacks for custom allocation.
  20. Normally :manpage:`malloc(3)` and :manpage:`free(3)` are used for allocation and releasing workloads. You can use :c:func:`gearman_client_set_memory_allocators` and :c:func:`gearman_worker_set_memory_allocators` to set your own custom allocators.
  21. ------------
  22. RETURN VALUE
  23. ------------
  24. None
  25. .. seealso::
  26. :manpage:`gearmand(8)` :manpage:`libgearman(3)` :manpage:`gearman_client_st(3)`