Class: HeapInfo::Tcache

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

Overview

Fetch tcache structure and show its content.

Constant Summary collapse

MAX_BINS =

#define TCACHE_MAX_BINS 64

64

Instance Method Summary collapse

Constructor Details

#initialize(base, size_t, dumper) ⇒ Tcache

Instantiate a HeapInfo::Tcache object.

Parameters:

  • base (Integer) —

    Base address of tcache.

  • size_t (Integer) —

    Either 8 or 4.

  • dumper (Proc) —

    For dumping more data.



15
16
17
18
19
# File 'lib/heapinfo/tcache.rb', line 15

def initialize(base, size_t, dumper)
  @base = base
  @size_t = size_t
  @dumper = dumper
end

Instance Method Details

#layouts ⇒ String

Pretty dump of tcache entries.

Returns:

  • (String) —

    Tcache entries that wrapper with color codes.



24
25
26
# File 'lib/heapinfo/tcache.rb', line 24

def layouts
  entries.map(&:inspect).join
end