OpenDNSSEC-signer  1.4.7
Data Structures | Typedefs | Functions
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 38 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]allocatorthe allocator
[in]sizesize to allocate
[in]initinitialized data
Returns
void* pointer to allocated memory

Allocate memory and initialize with data.

Definition at line 105 of file allocator.c.

References allocator_alloc().

Referenced by allocator_strdup(), and tsig_rr_parse().

void* allocator_alloc_zero ( allocator_type allocator,
size_t  size 
)

Allocate memory and initialize to zero.

Parameters
[in]allocatorthe allocator
[in]sizesize to allocate
Returns
void* pointer to allocated memory

Allocate memory and initialize to zero.

Definition at line 89 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]allocatorfunction for allocating
[in]deallocatorfunction for deallocating
Returns
allocator_type* allocator

Create allocator.

Definition at line 47 of file allocator.c.

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

Referenced by adapter_create(), dnsin_create(), dnsout_create(), duration_create(), main(), notify_create(), query_create(), signconf_create(), sock_handle_tcp_accept(), task_create(), xfrd_create(), zone_create(), and zonelist_update().

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