Class: RBTree::NodeAllocator Private

Inherits:
Object
  • Object
show all
Defined in:
lib/rbtree.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Allocator for RBTree nodes.

Since:

  • 0.1.0

Direct Known Subclasses

NodePool

Instance Method Summary collapse

Instance Method Details

#allocate(key, value, color, left, right, parent) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

  • key (Object)

    the key

  • value (Object)

    the value

  • color (Boolean)

    the color (true=red, false=black)

  • left (Node)

    the left child

  • right (Node)

    the right child

  • parent (Node)

    the parent node

Since:

  • 0.1.0



2329
# File 'lib/rbtree.rb', line 2329

def allocate(key, value, color, left, right, parent) = RBTree::Node.new(key, value, color, left, right, parent)

#discard(count) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Notifies the allocator that count nodes were dropped in bulk rather than released individually, as RBTree#clear does.

The nodes are not reclaimed for reuse; this only keeps live-node statistics right.

Parameters:

  • count (Integer)

    the number of nodes discarded

Since:

  • 0.1.0



2343
# File 'lib/rbtree.rb', line 2343

def discard(count) = nil

#release(node) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Releases a node.

Parameters:

  • node (Node)

    the node to release

Since:

  • 0.1.0



2334
# File 'lib/rbtree.rb', line 2334

def release(node) = nil