ACC Programmer's Reference Guide
Chapter 3 105
ZCOM Tables and Data Structures
Data Buffer Pool
BFFLAG -Bufferflags
The use of the memory pool is based around a buffer flag field that
indicates the size of a memory block as well as containing a flag that
indicates whether the block is currently in use. This field appears at the
start and end of each buffer segment. This field is 32 bits long. The size of
the buffer is always a multiple of 8-bytes (so each buffer is 64-bit
aligned). This allows the low order bit to be used as the Used flag
(ZCOM-BFFLAG-BUSY). This field is located at both the s tart and end
of the block, so that adjacent blocks can be identified from either end of
any block.
Dummy Used flag -Startandendindicatorofmemorypool
This is a dummy buffer flag at the beginning and end of the buffer pool
area. The used flag is set to indicate this block is used, so the coalesce
algorithm will think there is a used block before the start of t he pool, and
after the end of the pool. The size is set to 0xFFFFFFFE so that these
dummy blocks can be distinguished from the legitimate ones.
BFNEXT - Pointer to next buffer on queue
BFPREV - Pointer to previous buffer on queue
These pointers are used to link all the f ree blocks within the memory
pool, to form a circular list. The free queue contains the initial pointer to
the first and last free block. The value in the pointer is the address of the
buffer flag (i.e., the address of the next block pointer in the block).
Table 3-32 Buffer flags BFFLAG Field
31 1 0
Block Size
Used flag
Block size The size of the memory block in bytes (including buffer flags).
Theblocksizeisalwaysamultipleof8bytes.However,thelower
(least significant) bit is used to indicate whether the block is used
or not, and is not included in the size of the block.
Used flag =0 Block is unused,
=1 Block is used










