SuperCollider CLASSES

ContiguousBlockAllocator

for better handling of dynamic allocation
Inherits from: Object

Description

A more robust replacement for the default server block allocator, PowerOfTwoAllocator. May be used in the Server class to allocate audio/control bus numbers and buffer numbers.

To configure a server to use ContiguousBlockAllocator, execute the following:

aServer.options.blockAllocClass = ContiguousBlockAllocator;

Normally you will not need to address the allocators directly. However, ContiguousBlockAllocator adds one feature not present in PowerOfTwoAllocator, namely the reserve method.

Class Methods

*new (size, pos: 0)

Create a new allocator with size slots. You may block off the first pos slots (the server's audioBusAllocator does this to reserve the hardware input and output buses).

Inherited class methods

Instance Methods

-alloc (n: 1)

Return the starting index of a free block that is n slots wide. The default is 1 slot.

-free (address)

Free a previously allocated block starting at address.

-reserve (address, size: 1, warn: true)

Mark a specific range of addresses as used so that the alloc method will not return any addresses within that range.

Inherited instance methods

Undocumented instance methods

-addToFreed (block)

-blocks

-debug (text)

-findAvailable (n)

-findNext (address)

-findPrevious (address)

-removeFromFreed (block)