malloc.c File Reference

#include "libc.h"

Data Structures

struct  s_malloc_overlay
union  u_block_descriptor

Defines

#define MALLOC_MAGIC   0xabadface
#define MYPOW2(Nb)   (2<<((Nb) - 1))
#define FREE_MAGIC   0xabadfac2

Typedefs

typedef s_malloc_overlay t_malloc_overlay
typedef u_block_descriptor t_block_descriptor

Functions

vaddr_t do_big_alloc (asid_t asid, int nb_pgs)
void * malloc (size_t nbytes)
int free2 (void *p)
void free (void *p)
void * realloc (void *p, size_t n)
void * calloc (size_t nelem, size_t elsize)

Variables

static int malloc_lock = __SIMPLELOCK_UNLOCKED
t_block_descriptorbuckets [32]

Define Documentation

#define FREE_MAGIC   0xabadfac2
 

#define MALLOC_MAGIC   0xabadface
 

#define MYPOW2 Nb   )     (2<<((Nb) - 1))
 


Typedef Documentation

typedef union u_block_descriptor t_block_descriptor
 

typedef struct s_malloc_overlay t_malloc_overlay
 


Function Documentation

void* calloc size_t  nelem,
size_t  elsize
 

vaddr_t do_big_alloc asid_t  asid,
int  nb_pgs
 

void free void *  p  ) 
 

int free2 void *  p  ) 
 

void* malloc size_t  nbytes  ) 
 

void* realloc void *  p,
size_t  n
 


Variable Documentation

t_block_descriptor* buckets[32]
 

Initial value:

{
  NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
  NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
  NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
  NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
}

int malloc_lock = __SIMPLELOCK_UNLOCKED [static]
 


Generated on Wed May 24 23:05:58 2006 for LSE/OS by  doxygen 1.4.6