This is Unofficial EPICS BASE Doxygen Site
yajl_alloc.h File Reference

Memory allocation macros for yajl. More...

#include "yajl_common.h"
+ Include dependency graph for yajl_alloc.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define YA_MALLOC(afs, sz)   (afs)->malloc((afs)->ctx, (sz))
 
#define YA_FREE(afs, ptr)   (afs)->free((afs)->ctx, (ptr))
 
#define YA_REALLOC(afs, ptr, sz)   (afs)->realloc((afs)->ctx, (ptr), (sz))
 

Functions

YAJL_API void yajl_set_default_alloc_funcs (yajl_alloc_funcs *yaf)
 

Detailed Description

Memory allocation macros for yajl.

default memory allocation routines for yajl which use malloc/realloc and free

Author
Lloyd Hilaiel

These macros are used inside YAJL instead of directly calling malloc(), realloc() or free(). They call the equivalent method in their yajl_alloc_funcs parameter afs.

Definition in file yajl_alloc.h.

Macro Definition Documentation

#define YA_FREE (   afs,
  ptr 
)    (afs)->free((afs)->ctx, (ptr))

Definition at line 33 of file yajl_alloc.h.

#define YA_MALLOC (   afs,
  sz 
)    (afs)->malloc((afs)->ctx, (sz))

Definition at line 32 of file yajl_alloc.h.

#define YA_REALLOC (   afs,
  ptr,
  sz 
)    (afs)->realloc((afs)->ctx, (ptr), (sz))

Definition at line 34 of file yajl_alloc.h.

Function Documentation

YAJL_API void yajl_set_default_alloc_funcs ( yajl_alloc_funcs yaf)

Definition at line 43 of file yajl_alloc.c.

44 {
45  yaf->malloc = yajl_internal_malloc;
46  yaf->free = yajl_internal_free;
47  yaf->realloc = yajl_internal_realloc;
48  yaf->ctx = NULL;
49 }
yajl_free_func free
Definition: yajl_common.h:75
#define NULL
Definition: catime.c:38
yajl_realloc_func realloc
Definition: yajl_common.h:72
yajl_malloc_func malloc
Definition: yajl_common.h:70