org.terracotta.offheapstore.storage.allocator
Class IntegerBestFitAllocator
java.lang.Object
org.terracotta.offheapstore.storage.allocator.IntegerBestFitAllocator
- All Implemented Interfaces:
- Iterable<Long>, Allocator
public final class IntegerBestFitAllocator
- extends Object
- implements Allocator
An aggressively best-fit allocator.
- Author:
- Chris Dennis
IntegerBestFitAllocator
public IntegerBestFitAllocator(OffHeapStorageArea storage)
- Create a best fit allocator backed by the given OffHeapStorageArea.
- Parameters:
storage - source of ByteBuffer instances
clear
public void clear()
- Specified by:
clear in interface Allocator
expand
public void expand(long increase)
- Specified by:
expand in interface Allocator
allocate
public long allocate(long size)
- Specified by:
allocate in interface Allocator
free
public void free(long address)
- Specified by:
free in interface Allocator
occupied
public long occupied()
- Specified by:
occupied in interface Allocator
toString
public String toString()
- Overrides:
toString in class Object
validateAllocator
public void validateAllocator()
- Debugging Support
- Specified by:
validateAllocator in interface Allocator
validateMallocedPointer
public int validateMallocedPointer(int m)
getLastUsedPointer
public long getLastUsedPointer()
- Specified by:
getLastUsedPointer in interface Allocator
getLastUsedAddress
public long getLastUsedAddress()
- Specified by:
getLastUsedAddress in interface Allocator
getMinimalSize
public int getMinimalSize()
- Specified by:
getMinimalSize in interface Allocator
getMaximumAddress
public long getMaximumAddress()
- Specified by:
getMaximumAddress in interface Allocator
iterator
public Iterator<Long> iterator()
- Specified by:
iterator in interface Iterable<Long>
Copyright © 2016. All rights reserved.