public class PowerOfTwoAllocator extends Object implements BlockAllocator
Modifier and Type | Class and Description |
---|---|
static class |
PowerOfTwoAllocator.Factory |
Constructor and Description |
---|
PowerOfTwoAllocator(int size) |
PowerOfTwoAllocator(int size,
int pos) |
Modifier and Type | Method and Description |
---|---|
int |
alloc(int n)
Allocates a new bus.
|
void |
free(int address)
Frees a bus, that is makes it available again for
new re-allocation.
|
List |
getAllocatedBlocks()
Queries a list of allocated blocks.
|
public PowerOfTwoAllocator(int size)
public PowerOfTwoAllocator(int size, int pos)
public int alloc(int n)
BlockAllocator
alloc
in interface BlockAllocator
n
- the number of
channels to allocate. must
be greater than zero.-1
if the allocator ran out of busses.public void free(int address)
BlockAllocator
free
in interface BlockAllocator
address
- the index of the buspublic List getAllocatedBlocks()
BlockAllocator
getAllocatedBlocks
in interface BlockAllocator
Block
Copyright © 2015–2022 SciJava. All rights reserved.