Class TailTraceRingBuffer

java.lang.Object
org.kink_lang.kink.internal.callstack.TailTraceRingBuffer

public class TailTraceRingBuffer extends Object
Ring buffer of traces of tail-calls.
  • Method Details

    • withSize

      public static TailTraceRingBuffer withSize(int size)
      Makes a ring buffer.
      Parameters:
      size - the size of the ring buffer.
      Returns:
      a new ring buffer with the specified size.
    • traces

      public List<Trace> traces()
      Returns the traces.
      Returns:
      the traces.
    • push

      public void push(Trace trace)
      Pushes the trace to the ring buffer.
      Parameters:
      trace - the trace.
    • reset

      public void reset()
      Make the ring buffer empty.
    • makeCopy

      public TailTraceRingBuffer makeCopy()
      New ring buffer equivalent to this buffer.
      Returns:
      a new ring buffer equivalent to this buffer.
    • copyFrom

      public void copyFrom(TailTraceRingBuffer src)
      Copy traces from src.
      Parameters:
      src - buffer from which traces are copied.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object arg)
      Overrides:
      equals in class Object