1 <!DOCTYPE html PUBLIC
"-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
4 <meta http-equiv=
"Content-Type" content=
"text/html; charset=UTF-8">
5 <meta http-equiv=
"Content-Style-Type" content=
"text/css">
7 <meta name=
"Generator" content=
"Cocoa HTML Writer">
8 <meta name=
"CocoaVersion" content=
"824.42">
9 <style type=
"text/css">
10 p
.p1
{margin: 0.0px 0.0px 0.0px 0.0px; font: 20.0px Helvetica
}
11 p
.p2
{margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica
; min-height: 14.0px}
12 p
.p3
{margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica
}
13 p
.p4
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
}
14 span
.s1
{color: #0019b7}
18 <p class=
"p1"><b>ContiguousBlockAllocator
</b></p>
19 <p class=
"p2"><br></p>
20 <p class=
"p3">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.
</p>
21 <p class=
"p2"><br></p>
22 <p class=
"p3">To configure a server to use ContiguousBlockAllocator, execute the following:
</p>
23 <p class=
"p2"><br></p>
24 <p class=
"p4">aServer.options.blockAllocClass =
<span class=
"s1">ContiguousBlockAllocator
</span>;
</p>
25 <p class=
"p2"><br></p>
26 <p class=
"p3">Normally you will not need to address the allocators directly. However, ContiguousBlockAllocator adds one feature not present in PowerOfTwoAllocator, namely the
<i>reserve
</i> method.
</p>
27 <p class=
"p2"><br></p>
28 <p class=
"p3"><b>*new(size, pos =
0)
</b></p>
29 <p class=
"p2"><br></p>
30 <p class=
"p3">Create a new allocator with
<i>size
</i> slots. You may block off the first
<i>pos
</i> slots (the server's audioBusAllocator does this to reserve the hardware input and output buses).
</p>
31 <p class=
"p2"><br></p>
32 <p class=
"p3"><b>alloc(n =
1)
</b></p>
33 <p class=
"p2"><br></p>
34 <p class=
"p3">Return the starting index of a free block that is
<i>n
</i> slots wide. The default is
1 slot.
</p>
35 <p class=
"p2"><br></p>
36 <p class=
"p3"><b>free(address)
</b></p>
37 <p class=
"p2"><br></p>
38 <p class=
"p3">Free a previously allocated block starting at
<i>address
</i>.
</p>
39 <p class=
"p2"><br></p>
40 <p class=
"p3"><b>reserve(address, size =
1)
</b></p>
41 <p class=
"p2"><br></p>
42 <p class=
"p3">Mark a specific range of addresses as used so that the alloc method will not return any addresses within that range.
</p>