mirror of
https://github.com/ryujinx-mirror/ryujinx.git
synced 2024-12-03 04:07:17 +01:00
6922862db8
* Implement intrusive red-black tree, use it for HLE kernel block manager * Implement TreeDictionary using IntrusiveRedBlackTree * Implement IntervalTree using IntrusiveRedBlackTree * Implement IntervalTree (on Ryujinx.Memory) using IntrusiveRedBlackTree * Make PredecessorOf and SuccessorOf internal, expose Predecessor and Successor properties on the node itself * Allocation free tree node lookup
16 lines
496 B
C#
16 lines
496 B
C#
namespace Ryujinx.Common.Collections
|
|
{
|
|
/// <summary>
|
|
/// Represents a node in the Red-Black Tree.
|
|
/// </summary>
|
|
public class IntrusiveRedBlackTreeNode<T> where T : IntrusiveRedBlackTreeNode<T>
|
|
{
|
|
public bool Color = true;
|
|
public T Left;
|
|
public T Right;
|
|
public T Parent;
|
|
|
|
public T Predecessor => IntrusiveRedBlackTreeImpl<T>.PredecessorOf((T)this);
|
|
public T Successor => IntrusiveRedBlackTreeImpl<T>.SuccessorOf((T)this);
|
|
}
|
|
} |