-
Notifications
You must be signed in to change notification settings - Fork 746
/
ContiguousBlockAllocator.html
44 lines (44 loc) · 2.27 KB
/
ContiguousBlockAllocator.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<title></title>
<meta name="Generator" content="Cocoa HTML Writer">
<meta name="CocoaVersion" content="824.42">
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 20.0px Helvetica}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px}
p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica}
p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco}
span.s1 {color: #0019b7}
</style>
</head>
<body>
<p class="p1"><b>ContiguousBlockAllocator</b></p>
<p class="p2"><br></p>
<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>
<p class="p2"><br></p>
<p class="p3">To configure a server to use ContiguousBlockAllocator, execute the following:</p>
<p class="p2"><br></p>
<p class="p4">aServer.options.blockAllocClass = <span class="s1">ContiguousBlockAllocator</span>;</p>
<p class="p2"><br></p>
<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>
<p class="p2"><br></p>
<p class="p3"><b>*new(size, pos = 0)</b></p>
<p class="p2"><br></p>
<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>
<p class="p2"><br></p>
<p class="p3"><b>alloc(n = 1)</b></p>
<p class="p2"><br></p>
<p class="p3">Return the starting index of a free block that is <i>n</i> slots wide. The default is 1 slot.</p>
<p class="p2"><br></p>
<p class="p3"><b>free(address)</b></p>
<p class="p2"><br></p>
<p class="p3">Free a previously allocated block starting at <i>address</i>.</p>
<p class="p2"><br></p>
<p class="p3"><b>reserve(address, size = 1)</b></p>
<p class="p2"><br></p>
<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>
</body>
</html>