GRPC Core  4.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Typedefs | Functions
alloc.h File Reference
#include <stddef.h>
#include <grpc/impl/codegen/port_platform.h>

Go to the source code of this file.

Data Structures

struct  gpr_allocation_functions
 

Typedefs

typedef struct
gpr_allocation_functions 
gpr_allocation_functions
 

Functions

GPRAPI void * gpr_malloc (size_t size)
 malloc. More...
 
GPRAPI void * gpr_zalloc (size_t size)
 like malloc, but zero all bytes before returning them More...
 
GPRAPI void gpr_free (void *ptr)
 free More...
 
GPRAPI void * gpr_realloc (void *p, size_t size)
 realloc, never returns NULL More...
 
GPRAPI void * gpr_malloc_aligned (size_t size, size_t alignment_log)
 aligned malloc, never returns NULL, will align to 1 << alignment_log More...
 
GPRAPI void gpr_free_aligned (void *ptr)
 free memory allocated by gpr_malloc_aligned More...
 
GPRAPI void gpr_set_allocation_functions (gpr_allocation_functions functions)
 Request the family of allocation functions in functions be used. More...
 
GPRAPI gpr_allocation_functions gpr_get_allocation_functions ()
 Return the family of allocation functions currently in effect. More...
 

Typedef Documentation

Function Documentation

GPRAPI void gpr_free ( void *  ptr)

free

GPRAPI void gpr_free_aligned ( void *  ptr)

free memory allocated by gpr_malloc_aligned

GPRAPI gpr_allocation_functions gpr_get_allocation_functions ( )

Return the family of allocation functions currently in effect.

GPRAPI void* gpr_malloc ( size_t  size)

malloc.

If size==0, always returns NULL. Otherwise this function never returns NULL. The pointer returned is suitably aligned for any kind of variable it could contain.

GPRAPI void* gpr_malloc_aligned ( size_t  size,
size_t  alignment_log 
)

aligned malloc, never returns NULL, will align to 1 << alignment_log

GPRAPI void* gpr_realloc ( void *  p,
size_t  size 
)

realloc, never returns NULL

GPRAPI void gpr_set_allocation_functions ( gpr_allocation_functions  functions)

Request the family of allocation functions in functions be used.

NOTE that this request will be honored in a best effort basis and that no guarantees are made about the default functions (eg, malloc) being called. The functions.free_fn implementation must be a no-op for NULL input.

GPRAPI void* gpr_zalloc ( size_t  size)

like malloc, but zero all bytes before returning them