#include <stdlib.h>
#include <string.h>
#include "BBC/BUG.h"
#include "BBC/RNG.h"
#include "BFU/BFA.h"
#include "BFU/BFU_fileDsc.h"
Data Structures | |
| struct | _BFA_acb |
| Balloon Flight Allocation Control Block. More... | |
| struct | _BFA_rcb |
| Underlying ring buffer. More... | |
Typedefs | |
| typedef _BFA_rcb | BFA_rcb |
| Typedef for stuct _BFA_rcb. | |
Functions | |
| int | initBfa (BFA_rcb *brcb, struct _RNG_rcb *rcb, unsigned char *pool, int pool_size, int max_alloc_size) |
| Initializes a BFA ring buffer control structure. More... | |
| int | BFA_copy (BFA_acb *acb, void *eop) |
| Copies any piece of memory that spills into the overflow area back to the top of the ring buffer pool. More... | |
| _BFU_fileDsc * | BFA_get (BFA_acb *acb, int nevts, int nsums, int nbytes) |
| Allocates the requested number of bytes for the requested number of events. More... | |
| BFA_acb * | BFA_open (int dsc_pool_size, int dsc_max_alloc_size, int evt_pool_size, int evt_max_alloc_size) |
| Allocates the control structure and memory for the BFA allocator. More... | |
| _RNG_rcb * | BFA_evtRcbGet (const BFA_acb *acb) |
| Simple query routine to get the control structure of the event descriptors ring buffer that BFA is managing. More... | |
| _RNG_rcb * | BFA_dscRcbGet (const BFA_acb *acb) |
| Simple query routine to get the control structure of the event ring buffer that BFA is managing. More... | |
| int | BFA_evtRcbReset (BFA_acb *acb) |
| Resets the event ring buffer to its initial state. More... | |
| int | BFA_dscRcbReset (BFA_acb *acb) |
| Resets the event descriptor ring buffer to its initial state. More... | |
DESCRIPTION
-----------
The memory manager is just a thin layer on top of the Ring Buffer Management routines. Its basic value added is to manage the copying of data when it spills into the overflow area of the ring buffer.
|
||||||||||||
|
Copies any piece of memory that spills into the overflow area back to the top of the ring buffer pool.
The eop pointer must also be, be definition, the next allocation pointer. |
|
|
Simple query routine to get the control structure of the event ring buffer that BFA is managing.
|
|
|
Resets the event descriptor ring buffer to its initial state.
|
|
|
Simple query routine to get the control structure of the event descriptors ring buffer that BFA is managing.
|
|
|
Resets the event ring buffer to its initial state.
|
|
||||||||||||||||||||
|
Allocates the requested number of bytes for the requested number of events.
|
|
||||||||||||||||||||
|
Allocates the control structure and memory for the BFA allocator.
Each memory pool is divided into three pieces. The total size is set by the 'pool_size'. An underflow area is allocated at the top of the pool and an overflow area is allocated at the bottom. These areas allow the internal memory manager to satisfy requests up to 'max_alloc_size' as contigious chunks of memory that also obey blocking (chunking) constraints. |
|
||||||||||||||||||||||||
|
Initializes a BFA ring buffer control structure.
|
1.2.14 written by Dimitri van Heesch,
© 1997-2002