DoubleBitmapAllocator
public struct DoubleBitmapAllocator<BitmapType: FixedWidthInteger & UnsignedInteger>:
BitmapAllocatorProtocol, CustomStringConvertible
An allocator that uses 2 UnsignedIntegers to store the allocated entries allowing upto 2x .bitWidth entries to
be allocated.
-
A textual description of the allocator.
Declaration
Swift
public var description: String { get }Return Value
A zero padding binary representation of the bitmap.
-
Declaration
Swift
public var entryCount: Int { get }Return Value
The total number of entries that can be allocated.
-
Declaration
Swift
public var freeEntryCount: Int { get }Return Value
The number of entries that have not been allocated.
-
Declaration
Swift
public var hasSpace: Bool { get }Return Value
A boolean value indicating whether the allocator has unallocated entries.
-
Creates a new, empty allocator.
Declaration
Swift
public init() -
Allocate the next free entry.
Declaration
Swift
public mutating func allocate() -> Int?Return Value
The next free entry or
nilif the allocator is full. -
Frees the entry allowing it to be reused.
Precondition
The entry must be currently allocated.Declaration
Swift
public mutating func free(entry: Int)Parameters
entryThe entry index to be freed.
View on GitHub
DoubleBitmapAllocator Structure Reference