Class: Heapviz::Heap

Inherits:
Object
  • Object
show all
Includes:
Config
Defined in:
lib/heapviz/heap.rb

Constant Summary

Constants included from Config

Config::HEAP_PAGE_ALIGN, Config::HEAP_PAGE_ALIGN_LOG, Config::HEAP_PAGE_ALIGN_MASK, Config::HEAP_PAGE_OBJ_LIMIT, Config::HEAP_PAGE_SIZE, Config::SIZEOF_PAGE_HEADER, Config::SIZEOF_RVALUE

Instance Method Summary collapse

Constructor Details

#initializeHeap

Returns a new instance of Heap.



7
8
9
# File 'lib/heapviz/heap.rb', line 7

def initialize
  @pages = {}
end

Instance Method Details

#get_or_build_page_for(slot) ⇒ Object



11
12
13
# File 'lib/heapviz/heap.rb', line 11

def get_or_build_page_for(slot)
  @pages[slot.page_body_address] ||= build_page(slot.page_body_address, slot.size)
end

#max_page_sizeObject



23
24
25
# File 'lib/heapviz/heap.rb', line 23

def max_page_size
  HEAP_PAGE_OBJ_LIMIT
end

#page_countObject



19
20
21
# File 'lib/heapviz/heap.rb', line 19

def page_count
  @pages.length
end

#pagesObject



15
16
17
# File 'lib/heapviz/heap.rb', line 15

def pages
  @pages.values
end