Logo Search packages:      
Sourcecode: samba-doc-ja version File versions

Simple memory allocator


Detailed Description

This is a very simple temporary memory allocator. To use it do the following:

1) when you first want to allocate a pool of meomry use talloc_init() and save the resulting context pointer somewhere

2) to allocate memory use talloc()

3) when _all_ of the memory allocated using this context is no longer needed use talloc_destroy()

talloc does not zero the memory. It guarantees memory of a TALLOC_ALIGN alignment

See also:
talloc.h


Classes

struct  talloc_chunk
struct  talloc_ctx
typedef struct talloc_ctx TALLOC_CTX

Functions

void * talloc (TALLOC_CTX *t, size_t size)
char * talloc_asprintf (TALLOC_CTX *t, const char *fmt,...)
char * talloc_asprintf_append (TALLOC_CTX *t, char *s, const char *fmt,...)
char * talloc_describe_all (TALLOC_CTX *rt)
void talloc_destroy (TALLOC_CTX *t)
void talloc_destroy_pool (TALLOC_CTX *t)
static void talloc_disenroll (TALLOC_CTX *t)
static void talloc_enroll (TALLOC_CTX *t)
void talloc_get_allocation (TALLOC_CTX *t, size_t *total_bytes, int *n_chunks)
TALLOC_CTXtalloc_init (void)
TALLOC_CTXtalloc_init_named (char const *fmt,...)
void * talloc_memdup (TALLOC_CTX *t, const void *p, size_t size)
const char * talloc_pool_name (TALLOC_CTX const *t)
size_t talloc_pool_size (TALLOC_CTX *t)
void * talloc_realloc (TALLOC_CTX *t, void *ptr, size_t size)
char * talloc_strdup (TALLOC_CTX *t, const char *p)
char * talloc_vasprintf (TALLOC_CTX *t, const char *fmt, va_list ap)
char * talloc_vasprintf_append (TALLOC_CTX *t, char *s, const char *fmt, va_list ap)
void * talloc_zero (TALLOC_CTX *t, size_t size)

Variables

TALLOC_CTXlist_head = NULL


Generated by  Doxygen 1.6.0   Back to index