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)
BlockAllocatoralloc in interface BlockAllocatorn - the number of
channels to allocate. must
be greater than zero.-1
if the allocator ran out of busses.public void free(int address)
BlockAllocatorfree in interface BlockAllocatoraddress - the index of the buspublic List getAllocatedBlocks()
BlockAllocatorgetAllocatedBlocks in interface BlockAllocatorBlockCopyright © 2015–2022 SciJava. All rights reserved.