A ContiguousBlock is a range of addresses (generally integers >= 0) used in a ContiguousBlockAllocator. ContiguousBlockAllocator is used in Server to manage buffer numbers and audio/control bus indices.
ContiguousBlock(10, 2)
spans address indices 10 and 11.
Additionally, a ContiguousBlock may be marked as in use or free. See -used.
Returns a new instance.
start |
The starting address of the block. |
size |
The number of addresses after |
The starting address of the block.
The number of addresses covered in the block.
A synonym for start
.
The starting address of the block.
The last address covered within this block: ContiguousBlock(10, 2).lastAddress
returns 11.
The starting address immediately following this block. ContiguousBlock(10, 2).lastAddress
returns 12, because an adjoining block following this block must begin at address 12.
Boolean. true
indicates that the block is in use, and false
that it is available.
Answers true
if this block touches or overlaps with the argument, and false
if there is a gap between the two blocks.
block |
A second |
Boolean.
Given two adjoining blocks, combines them into a single block. If the blocks do not adjoin, the result is nil
.
block |
A second |
A new ContiguousBlock, spanning the full range of both input blocks.
Divides a ContiguousBlock into two new blocks.
span |
The size of the first new block. The remainder of the receiver block's size will be allocated to the second block. |
There are three return cases: