Struct Block
A memory allocation block.
public readonly record struct Block : IEquatable<Block>
- Implements
- Inherited Members
Constructors
Block(int, int)
public Block(int head, int tail)
Parameters
Fields
Empty
An empty block.
public static readonly Block Empty
Field Value
Properties
Count
The number of items in this block.
public int Count { get; }
Property Value
Head
The start of this block.
public int Head { get; }
Property Value
Tail
The end of this block. Exclusive.
public int Tail { get; }
Property Value
Methods
Locate(Block)
public BlockLocation Locate(Block other)
Parameters
other
Block
Returns
TrySplit(int, out Block, out Block)
Split this block into two segments.
public bool TrySplit(int at, out Block a, out Block b)
Parameters
Returns
- bool
True if the split was possible.
TryUnion(out Block, in Block, in Block)
Try joining two blocks.
public static bool TryUnion(out Block result, in Block a, in Block b)
Parameters
Returns
- bool
True if the blocks were adjacent. False otherwise.
Operators
implicit operator Range(in Block)
public static implicit operator Range(in Block block)
Parameters
block
Block