src/alloc/clfmalloc.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <pthread.h>
#include <string.h>
#include <sys/mman.h>
#include <amino/config.h>

Classes

union  anchor
struct  desc
struct  procheap
struct  sizeclass
struct  controlblock_t

Defines

#define FALSE   0
#define TRUE   1
#define EIGHT   8
#define STATS(x)
#define MIN(x, y)   ((x)<=(y)?(x):(y))
#define MMAP(size)   mmap(0,size,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE,-1,0)
#define ASSERT(x)
#define IFUNI
#define ret_t   void *
#define rc_ret_t   unsigned
#define aret_t   void *
#define FAA(oldval, addr, val)
#define SAFE_READ(x)   rc_safe_read(&x)
#define DESC_RETIRE(x)   rc_desc_release(x)
#define RC_INIT(x)   x->rc = 1
#define RC_RELEASE(x)   rc_desc_release(x)
#define MAXSIZECLASSES   32
#define MAXCREDITS   128
#define CREDITSMASK   127
#define DESCBATCHSIZE   128
#define DESCSBSIZE   DESCBATCHSIZE*sizeof(desc_t)
#define HYPERBLOCKSIZE   1024*1024
#define DEFAULTNUMHEAPS   64
#define MAXNUMHEAPS   512
#define NUMSIZECLASSES   27
#define DOTRACE(a, b, c, d, e, f, g)
#define TRACE(a, b, c, d, e, f, g)

Typedefs

typedef union anchor anchor_t
typedef struct desc desc_t
typedef struct procheap procheap_t
typedef struct sizeclass sizeclass_t

Functions

 __attribute__ ((constructor))
void free (void *ptr)
void * malloc (size_t sz)
void * calloc (size_t n, size_t sz)
void * realloc (void *ptr, size_t sz)

Define Documentation

#define aret_t   void *

#define ASSERT (  ) 

#define CREDITSMASK   127

#define DEFAULTNUMHEAPS   64

#define DESC_RETIRE (  )     rc_desc_release(x)

#define DESCBATCHSIZE   128

#define DESCSBSIZE   DESCBATCHSIZE*sizeof(desc_t)

#define DOTRACE ( a,
b,
c,
d,
e,
f,
 ) 

Value:

if (!trace_stop) { \
        unsigned id; \
        unsigned i; \
        id =  (pthread_self() & 0xf)-1; /* only for AIX */ \
        i = trace_ind[id][0]++ & TRACEMASK; \
        tr[id][i].op = a; \
        tr[id][i].sz = b; \
        tr[id][i].desc = d; \
        tr[id][i].heap = f; \
        tr[id][i].anchor.all = g; \
    }

#define EIGHT   8

#define FAA ( oldval,
addr,
val   ) 

Value:

do { \
        ret_t ret; \
        ptrsize_t newval; \
        oldval = *(addr); \
        newval = (ptrsize_t)oldval + val; \
        CAS(ret,addr,newval); \
        if (ret) break; \
    } while (1);

#define FALSE   0

#define HYPERBLOCKSIZE   1024*1024

#define IFUNI

#define MAXCREDITS   128

#define MAXNUMHEAPS   512

#define MAXSIZECLASSES   32

#define MIN ( x,
 )     ((x)<=(y)?(x):(y))

#define MMAP ( size   )     mmap(0,size,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE,-1,0)

#define NUMSIZECLASSES   27

#define RC_INIT (  )     x->rc = 1

#define RC_RELEASE (  )     rc_desc_release(x)

#define rc_ret_t   unsigned

#define ret_t   void *

#define SAFE_READ (  )     rc_safe_read(&x)

#define STATS (  ) 

#define TRACE ( a,
b,
c,
d,
e,
f,
 ) 

#define TRUE   1


Typedef Documentation

typedef union anchor anchor_t

typedef struct desc desc_t

typedef struct procheap procheap_t

typedef struct sizeclass sizeclass_t


Function Documentation

__attribute__ ( (constructor)   ) 

void* calloc ( size_t  n,
size_t  sz 
)

void free ( void *  ptr  ) 

void* malloc ( size_t  sz  ) 

void* realloc ( void *  ptr,
size_t  sz 
)


Generated on Tue Dec 9 13:39:39 2008 for Amino by  doxygen 1.5.6