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

mm.h File Reference

#include "imports.h"

Data Structures

struct  mem_block
 Memory manager code. More...

Functions

struct mem_blockmmInit (unsigned ofs, unsigned size)
 input: total size in bytes return: a heap pointer if OK, NULL if error
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.
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_blockmmFindBlock (struct mem_block *heap, unsigned start)
 Free block starts at offset input: pointer to a heap, start offset return: pointer to a block.
void mmDestroy (struct mem_block *mmInit)
 destroy MM
void mmDumpMemInfo (const struct mem_block *mmInit)
 For debuging purpose.


Function Documentation

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 mmInit  ) 

destroy MM

void mmDumpMemInfo ( const struct mem_block mmInit  ) 

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


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