src/bufferPool_d.c File Reference

More...

#include "tll_common.h"
#include <stdlib.h>
#include "bufferPool_d.h"

Include dependency graph for bufferPool_d.c:


Functions

int bufferPool_d_init (bufferPool_d_t *pThis, int numChunks, int chunkSize)
 Initialize buffer pool
  • initialize freeList, populate with chunks.

int bufferPool_d_acquire (bufferPool_d_t *pThis, chunk_d_t **ppChunk, int chunkSize)
 Get a chunk from the buffer pool.
int bufferPool_d_release (bufferPool_d_t *pThis, chunk_d_t *pChunk)
 Release chunk into the free list
  • non blocking
  • error on null passed.

int bufferPool_is_empty (bufferPool_d_t *pThis)
 Returns true if buffer pool is empty.

Detailed Description

Author:
Gunar Schirner Rohan Kangralkar Oleg Vaskevich
Date:
03/15/2009
LastChange:
Id
bufferPool_d.c 1069 2013-02-25 18:19:21Z ovaskevi

Function Documentation

int bufferPool_d_acquire ( bufferPool_d_t pThis,
chunk_d_t **  ppChunk,
int  chunkSize 
)

Get a chunk from the buffer pool.

Parameters:

Parameters:
pThis pointer to queue data structure
ppChunk pointer pointer to chunk acquired (null if empty)
chunkSize the size of each chunk
Returns:
PASS/Zero on success. Negative FAIL/value on failure.

int bufferPool_d_init ( bufferPool_d_t pThis,
int  numChunks,
int  chunkSize 
)

Initialize buffer pool

Parameters:

Parameters:
pThis pointer to buffer pool data structure
Returns:
PASS/Zero on success. FAIL/Negative value on failure.

int bufferPool_d_release ( bufferPool_d_t pThis,
chunk_d_t pChunk 
)

Release chunk into the free list

Parameters:

Parameters:
pThis pointer to queue data structure
pChunk pointer to chunk to release
Returns:
PASS/Zero on success. FAIL/Negative value on failure.

int bufferPool_is_empty ( bufferPool_d_t pThis  ) 

Returns true if buffer pool is empty.

Parameters:

Parameters:
pThis pointer to queue data structure
Returns:
true (non-zero) if emtpy, 0 if chunks available


Generated on 3 Mar 2014 for PAL bare-c Library by  doxygen 1.4.7