Classes | Defines | Typedefs | Functions
malloc.h File Reference
#include <sys/types.h>
#include <stdarg.h>
#include <limits.h>
#include <assert.h>
#include <avahi-common/cdecl.h>
#include <avahi-common/gccmacro.h>
Include dependency graph for malloc.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  AvahiAllocator

Defines

#define avahi_new(type, n)   ((type*) avahi_new_internal((n), sizeof(type)))
#define avahi_new0(type, n)   ((type*) avahi_new0_internal((n), sizeof(type)))

Typedefs

typedef struct AvahiAllocator AvahiAllocator

Functions

void avahi_free (void *p)
AVAHI_C_DECL_BEGIN voidavahi_malloc (size_t size)
voidavahi_malloc0 (size_t size)
voidavahi_memdup (const void *s, size_t l)
static voidavahi_new0_internal (unsigned n, size_t k)
static voidavahi_new_internal (unsigned n, size_t k)
voidavahi_realloc (void *p, size_t size)
void avahi_set_allocator (const AvahiAllocator *a)
char * avahi_strdup (const char *s)
char * avahi_strdup_printf (const char *fmt,...) AVAHI_GCC_PRINTF_ATTR12
char * avahi_strndup (const char *s, size_t l)

Detailed Description

Memory allocation

Definition in file malloc.h.


Define Documentation

#define avahi_new (   type,
 
)    ((type*) avahi_new_internal((n), sizeof(type)))

Allocate n new structures of the specified type.

Definition at line 56 of file malloc.h.

#define avahi_new0 (   type,
 
)    ((type*) avahi_new0_internal((n), sizeof(type)))

Same as avahi_new() but set the memory to zero

Definition at line 65 of file malloc.h.


Typedef Documentation

Wraps allocator functions


Function Documentation

void avahi_free ( void p)

Free some memory

Allocate some memory, just like the libc malloc()

void* avahi_malloc0 ( size_t  size)

Similar to avahi_malloc() but set the memory to zero

void* avahi_memdup ( const void s,
size_t  l 
)

Duplicate the given memory block into a new one allocated with avahi_malloc()

static void* avahi_new0_internal ( unsigned  n,
size_t  k 
) [inline, static]

Internal helper for avahi_new0()

Definition at line 59 of file malloc.h.

static void* avahi_new_internal ( unsigned  n,
size_t  k 
) [inline, static]

Internal helper for avahi_new()

Definition at line 50 of file malloc.h.

void* avahi_realloc ( void p,
size_t  size 
)

Similar to libc's realloc()

Change the allocator. May be NULL to return to default (libc) allocators. The structure is not copied!

char* avahi_strdup ( const char *  s)

Just like libc's strdup()

char* avahi_strdup_printf ( const char *  fmt,
  ... 
)

Like sprintf() but store the result in a freshly allocated buffer. Free this with avahi_free()

char* avahi_strndup ( const char *  s,
size_t  l 
)

Just like libc's strndup()



pedal_monitor
Author(s): Pedro Mendes
autogenerated on Fri Jun 6 2014 18:37:21