Class: Heapviz::Heap
- Inherits:
-
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
#initialize ⇒ Heap
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
|
#page_count ⇒ Object
19
20
21
|
# File 'lib/heapviz/heap.rb', line 19
def page_count
@pages.length
end
|
#pages ⇒ Object
15
16
17
|
# File 'lib/heapviz/heap.rb', line 15
def pages
@pages.values
end
|