Main Page | Alphabetical List | Class List | File List | Class Members | File Members

bsdmalloc.h File Reference

#include <nlibc.h>
#include <unistd.h>

Include dependency graph for bsdmalloc.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Classes

union  overhead

Defines

#define overhead   __malloc_overhead
#define pagebucket   __malloc_pagebucket
#define pagesz   __malloc_pagesz
#define nmalloc   __malloc_nmalloc
#define realloc_srchlen   __malloc_realloc_srchlen
#define ov_magic   ovu.ovu_magic
#define ov_index   ovu.ovu_index
#define ov_rmagic   ovu.ovu_rmagic
#define ov_size   ovu.ovu_size
#define MAGIC   0xef
#define RMAGIC   0x5555
#define RSLOP   0
#define NBUCKETS   30
#define MALLOC_ASSERT(p)
#define w_sizeof(OBJ)   (sizeof_aligned(OBJ)>>4)
#define malloc(BYTES)   wmalloc(((BYTES)+15)>>4)
#define realloc(PTR, NBYTES)   wrealloc(PTR,((NBYTES)+15)>>4)
#define calloc(N, BYTESIZE)   wcalloc((N),((BYTESIZE+15)>>4))

Functions

int getpagesize ()
void morecore ()
int findbucket ()
void * wmalloc (size_t nwords)
void free (void *cp)
void * wrealloc (void *cp, size_t nwords)
void * wcalloc (size_t nmemb, size_t words)

Variables

overheadnextf [NBUCKETS]
int pagebucket = 0
int pagesz = 0
int realloc_srchlen = 4


Define Documentation

#define calloc N,
BYTESIZE   )     wcalloc((N),((BYTESIZE+15)>>4))
 

calloc() allocates memory for an array of nmemb elements of size bytes each and returns a pointer to the allocated memory. The memory is set to zero.

Definition at line 419 of file bsdmalloc.h.

#define MAGIC   0xef
 

Definition at line 104 of file bsdmalloc.h.

#define malloc BYTES   )     wmalloc(((BYTES)+15)>>4)
 

Definition at line 156 of file bsdmalloc.h.

#define MALLOC_ASSERT  ) 
 

Definition at line 151 of file bsdmalloc.h.

#define NBUCKETS   30
 

Definition at line 119 of file bsdmalloc.h.

#define nmalloc   __malloc_nmalloc
 

Definition at line 85 of file bsdmalloc.h.

#define ov_index   ovu.ovu_index
 

Definition at line 99 of file bsdmalloc.h.

#define ov_magic   ovu.ovu_magic
 

Definition at line 98 of file bsdmalloc.h.

#define ov_rmagic   ovu.ovu_rmagic
 

Definition at line 100 of file bsdmalloc.h.

#define ov_size   ovu.ovu_size
 

Definition at line 101 of file bsdmalloc.h.

#define overhead   __malloc_overhead
 

Definition at line 82 of file bsdmalloc.h.

#define pagebucket   __malloc_pagebucket
 

Definition at line 83 of file bsdmalloc.h.

#define pagesz   __malloc_pagesz
 

Definition at line 84 of file bsdmalloc.h.

#define realloc PTR,
NBYTES   )     wrealloc(PTR,((NBYTES)+15)>>4)
 

Definition at line 341 of file bsdmalloc.h.

#define realloc_srchlen   __malloc_realloc_srchlen
 

Definition at line 86 of file bsdmalloc.h.

#define RMAGIC   0x5555
 

Definition at line 105 of file bsdmalloc.h.

#define RSLOP   0
 

Definition at line 110 of file bsdmalloc.h.

#define w_sizeof OBJ   )     (sizeof_aligned(OBJ)>>4)
 

Definition at line 154 of file bsdmalloc.h.


Function Documentation

int findbucket  )  [static]
 

void free void *  cp  ) 
 

int getpagesize  )  [inline]
 

Definition at line 62 of file bsdmalloc.h.

void morecore  )  [static]
 

void* wcalloc size_t  nmemb,
size_t  words
[inline]
 

wcalloc() allocates memory for an array of nmemb elements of size words each and returns a pointer to the allocated memory. The memory is set to zero.

Definition at line 429 of file bsdmalloc.h.

References size_t, wmalloc(), and wmemset().

void* wmalloc size_t  nwords  ) 
 

Referenced by wcalloc().

void* wrealloc void *  cp,
size_t  nwords
 


Variable Documentation

union overhead* nextf[NBUCKETS] [static]
 

Definition at line 120 of file bsdmalloc.h.

int pagebucket = 0 [static]
 

Definition at line 122 of file bsdmalloc.h.

int pagesz = 0 [static]
 

Definition at line 123 of file bsdmalloc.h.

int realloc_srchlen = 4
 

Definition at line 339 of file bsdmalloc.h.


Generated on Fri Jul 14 10:51:36 2006 for nlibc by doxygen 1.3.5