src/gang.c File Reference

#include <compiler.h>
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include <gang.h>
Include dependency graph for gang.c:

Go to the source code of this file.

Data Structures

struct  _slab
struct  _gang

Defines

#define POISON(ptr, len)   do { } while(0);

Functions

gang_t gang_new (size_t alloc, size_t align)
static uint8_t * ptr_align (uint8_t *ptr, size_t sz)
static void * do_alloc_slow (struct _gang *g, size_t sz, size_t align)
static void * do_alloc (struct _gang *g, size_t sz, size_t align)
void * gang_alloc (gang_t g, size_t sz)
void * gang_alloc_a (gang_t g, size_t sz, size_t align)
void * gang_alloc0 (gang_t g, size_t sz)
void * gang_alloc0_a (gang_t g, size_t sz, size_t align)
void gang_free (gang_t g)

Define Documentation

#define POISON ( ptr,
len   )     do { } while(0);

Definition at line 15 of file gang.c.

Referenced by do_alloc_slow(), gang_free(), mpool_alloc_slow(), mpool_free(), and mpool_return().


Function Documentation

static void* do_alloc ( struct _gang g,
size_t  sz,
size_t  align 
) [static]

Definition at line 76 of file gang.c.

References do_alloc_slow(), _gang::g_alloc, _gang::g_ptr, _gang::g_slab, and ptr_align().

Referenced by gang_alloc(), gang_alloc0(), gang_alloc0_a(), and gang_alloc_a().

Here is the call graph for this function:

Here is the caller graph for this function:

static void* do_alloc_slow ( struct _gang g,
size_t  sz,
size_t  align 
) [static]

Definition at line 52 of file gang.c.

References _gang::g_alloc, _gang::g_ptr, _gang::g_slab, POISON, ptr_align(), _slab::s_data, and _slab::s_next.

Referenced by do_alloc().

Here is the call graph for this function:

Here is the caller graph for this function:

void* gang_alloc ( gang_t  g,
size_t  sz 
)

Definition at line 91 of file gang.c.

References do_alloc(), and _gang::g_align.

Referenced by composite(), decode_record(), and emv_read_app_data().

Here is the call graph for this function:

Here is the caller graph for this function:

void* gang_alloc0 ( gang_t  g,
size_t  sz 
)

Definition at line 101 of file gang.c.

References do_alloc(), and _gang::g_align.

Here is the call graph for this function:

void* gang_alloc0_a ( gang_t  g,
size_t  sz,
size_t  align 
)

Definition at line 110 of file gang.c.

References do_alloc().

Here is the call graph for this function:

void* gang_alloc_a ( gang_t  g,
size_t  sz,
size_t  align 
)

Definition at line 96 of file gang.c.

References do_alloc().

Here is the call graph for this function:

void gang_free ( gang_t  g  ) 

Definition at line 119 of file gang.c.

References _gang::g_alloc, _gang::g_slab, POISON, and _slab::s_next.

Referenced by do_emv_fini(), and emv_read_app_data().

Here is the caller graph for this function:

gang_t gang_new ( size_t  alloc,
size_t  align 
)

Definition at line 30 of file gang.c.

References _gang::g_align, _gang::g_alloc, _gang::g_ptr, _gang::g_slab, and GANG_DEFAULT_ALLOC.

Referenced by emv_init(), and emv_read_app_data().

Here is the caller graph for this function:

static uint8_t* ptr_align ( uint8_t *  ptr,
size_t  sz 
) [static]

Definition at line 46 of file gang.c.

Referenced by do_alloc(), and do_alloc_slow().

Here is the caller graph for this function:

Generated on Sun Jan 2 08:35:43 2011 for ccid-utils by  doxygen 1.6.3