ubuffer.h File Reference

fast/static buffer management More...

Go to the source code of this file.

Data Structures

struct  ubufm

Functions

void * uBufGet (struct ubufm *dis)
void * uBufGetBufByIndex (unsigned int index, struct ubufm *dis)
void * uBufGetCt (struct ubufm *dis)
int uBufGetIndex (void *p, struct ubufm *dis)
int uBufInit (struct ubufm *dis)
int uBufPut (void *p, struct ubufm *dis)
int uBufPutCt (void *p, struct ubufm *dis)


Detailed Description

fast/static buffer management

Author:
Created by Ricky, 2003.6.10

Definition in file ubuffer.h.


Function Documentation

void* uBufGet ( struct ubufm dis  ) 

get buffer from pool

Definition at line 78 of file ubuffer.c.

References ubufm::freeList.

Referenced by uffs_GetObject().

void* uBufGetBufByIndex ( unsigned int  index,
struct ubufm dis 
)

get buffer pointer by index(offset)

Definition at line 137 of file ubuffer.c.

References ubufm::node_pool, and ubufm::node_size.

Referenced by uffs_GetObjectByIndex().

void* uBufGetCt ( struct ubufm dis  ) 

get buffer from pool this is Critical protect version, you should use this version when multitherad access the same buffer pool

Definition at line 94 of file ubuffer.c.

References ubufm::freeList.

int uBufGetIndex ( void *  p,
struct ubufm dis 
)

get index by pointer

Definition at line 143 of file ubuffer.c.

References ubufm::node_pool, and ubufm::node_size.

Referenced by uffs_GetObjectIndex().

int uBufInit ( struct ubufm dis  ) 

init ubuffer data structure with given discriptor

Definition at line 53 of file ubuffer.c.

References ubufm::freeList, ubufm::node_nums, ubufm::node_pool, ubufm::node_size, and NULL.

Referenced by uffs_InitObjectBuf(), and uffs_InitTreeBuf().

int uBufPut ( void *  p,
struct ubufm dis 
)

put buffer to pool

Definition at line 109 of file ubuffer.c.

References ubufm::freeList.

Referenced by uffs_PutObject().

int uBufPutCt ( void *  p,
struct ubufm dis 
)

put buffer to pool, this is critical protect version, you should use this version when multithread access the same buffer pool

Definition at line 124 of file ubuffer.c.


Generated on Sat Mar 17 15:45:45 2007 for uffs-doc by  doxygen 1.5.0