Data Structures | Typedefs | Functions

/build/buildd-opendnssec_1.3.2-1~bpo60+1-kfreebsd-i386-KuwQV_/opendnssec-1.3.2/signer/src/shared/allocator.h File Reference

#include "config.h"
#include <stdlib.h>
Include dependency graph for allocator.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  allocator_struct

Typedefs

typedef struct allocator_struct allocator_type

Functions

allocator_typeallocator_create (void *(*allocator)(size_t size), void(*deallocator)(void *))
void * allocator_alloc (allocator_type *allocator, size_t size)
void * allocator_alloc_zero (allocator_type *allocator, size_t size)
void * allocator_alloc_init (allocator_type *allocator, size_t size, const void *init)
char * allocator_strdup (allocator_type *allocator, const char *string)
void allocator_deallocate (allocator_type *allocator, void *data)
void allocator_cleanup (allocator_type *allocator)

Typedef Documentation

Memory management.

Definition at line 41 of file allocator.h.


Function Documentation

void* allocator_alloc ( allocator_type allocator,
size_t  size 
)
void* allocator_alloc_init ( allocator_type allocator,
size_t  size,
const void *  init 
)

Allocate memory and initialize with data.

Parameters:
[in] allocator the allocator
[in] size size to allocate
[in] init initialized data
Returns:
void* pointer to allocated memory

Allocate memory and initialize with data.

Definition at line 106 of file allocator.c.

References allocator_alloc().

Referenced by allocator_strdup().

void* allocator_alloc_zero ( allocator_type allocator,
size_t  size 
)

Allocate memory and initialize to zero.

Parameters:
[in] allocator the allocator
[in] size size to allocate
Returns:
void* pointer to allocated memory

Allocate memory and initialize to zero.

Definition at line 90 of file allocator.c.

References allocator_alloc().

void allocator_cleanup ( allocator_type allocator  ) 
allocator_type* allocator_create ( void *(*)(size_t size)  allocator,
void(*)(void *)  deallocator 
)

Create allocator.

Parameters:
[in] allocator function for allocating
[in] deallocator function for deallocating
Returns:
allocator_type* allocator

Create allocator.

Definition at line 48 of file allocator.c.

References allocator_struct::allocator, allocator_struct::deallocator, and ods_log_error().

Referenced by adapter_create(), denial_create(), domain_create(), duration_create(), main(), nsec3params_create(), rrset_create(), rrsigs_create(), signconf_create(), task_create(), zone_create(), and zonelist_update().

void allocator_deallocate ( allocator_type allocator,
void *  data 
)
char* allocator_strdup ( allocator_type allocator,
const char *  string 
)