core | glapi | vbo | math | shader | swrast | swrast_setup | tnl | tnl_dd

mm.c File Reference

#include "mm.h"

Functions

void mmDumpMemInfo (const struct mem_block *heap)
 For debuging purpose.
struct mem_blockmmInit (unsigned ofs, unsigned size)
 input: total size in bytes return: a heap pointer if OK, NULL if error
static struct mem_blockSliceBlock (struct mem_block *p, unsigned startofs, unsigned size, unsigned reserved, unsigned alignment)
struct mem_blockmmAllocMem (struct mem_block *heap, unsigned size, unsigned align2, unsigned startSearch)
 Allocate 'size' bytes with 2^align2 bytes alignment, restrict the search to free memory after 'startSearch' depth and back buffers should be in different 4mb banks to get better page hits if possible input: size = size of block align2 = 2^align2 bytes alignment startSearch = linear offset from start of heap to begin search return: pointer to the allocated block, 0 if error.
struct mem_blockmmFindBlock (struct mem_block *heap, unsigned start)
 Free block starts at offset input: pointer to a heap, start offset return: pointer to a block.
static INLINE int Join2Blocks (struct mem_block *p)
int mmFreeMem (struct mem_block *b)
 Free block starts at offset input: pointer to a block return: 0 if OK, -1 if error.
void mmDestroy (struct mem_block *heap)
 destroy MM


Function Documentation

static INLINE int Join2Blocks ( struct mem_block p  )  [static]

struct mem_block* mmAllocMem ( struct mem_block heap,
unsigned  size,
unsigned  align2,
unsigned  startSearch 
) [read]

Allocate 'size' bytes with 2^align2 bytes alignment, restrict the search to free memory after 'startSearch' depth and back buffers should be in different 4mb banks to get better page hits if possible input: size = size of block align2 = 2^align2 bytes alignment startSearch = linear offset from start of heap to begin search return: pointer to the allocated block, 0 if error.

void mmDestroy ( struct mem_block heap  ) 

destroy MM

void mmDumpMemInfo ( const struct mem_block heap  ) 

For debuging purpose.

struct mem_block* mmFindBlock ( struct mem_block heap,
unsigned  start 
) [read]

Free block starts at offset input: pointer to a heap, start offset return: pointer to a block.

int mmFreeMem ( struct mem_block b  ) 

Free block starts at offset input: pointer to a block return: 0 if OK, -1 if error.

struct mem_block* mmInit ( unsigned  ofs,
unsigned  size 
) [read]

input: total size in bytes return: a heap pointer if OK, NULL if error

static struct mem_block* SliceBlock ( struct mem_block p,
unsigned  startofs,
unsigned  size,
unsigned  reserved,
unsigned  alignment 
) [static, read]


Generated on Sun Sep 27 06:47:46 2009 for Mesa Main by  doxygen 1.5.4