#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 aret_t void * |
#define ASSERT | ( | x | ) |
#define CREDITSMASK 127 |
#define DEFAULTNUMHEAPS 64 |
#define DESC_RETIRE | ( | x | ) | rc_desc_release(x) |
#define DESCBATCHSIZE 128 |
#define DESCSBSIZE DESCBATCHSIZE*sizeof(desc_t) |
#define DOTRACE | ( | a, | |||
b, | |||||
c, | |||||
d, | |||||
e, | |||||
f, | |||||
g | ) |
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 | ) |
#define FALSE 0 |
#define HYPERBLOCKSIZE 1024*1024 |
#define IFUNI |
#define MAXCREDITS 128 |
#define MAXNUMHEAPS 512 |
#define MAXSIZECLASSES 32 |
#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 NUMSIZECLASSES 27 |
#define RC_INIT | ( | x | ) | x->rc = 1 |
#define RC_RELEASE | ( | x | ) | rc_desc_release(x) |
#define rc_ret_t unsigned |
#define ret_t void * |
#define SAFE_READ | ( | x | ) | rc_safe_read(&x) |
#define STATS | ( | x | ) |
#define TRACE | ( | a, | |||
b, | |||||
c, | |||||
d, | |||||
e, | |||||
f, | |||||
g | ) |
#define TRUE 1 |
typedef struct procheap procheap_t |
typedef struct sizeclass sizeclass_t |
__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 | |||
) |