Skip to content

Commit

Permalink
get both heap analyses running merged together and cleaned up
Browse files Browse the repository at this point in the history
  • Loading branch information
jackbackrack committed Jan 28, 2025
1 parent b71b42c commit 7fd0a73
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions core/core.stanza
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,11 @@ protected lostanza deftype HeapStatistic :
extern-table: ptr<ExternTable>
extern-defn-table: ptr<ExternDefnTable>

#else:

lostanza defn initialize-dominator-tree () -> ref<False> :
return false

#else:

protected lostanza deftype HeapDominator :
var roots : ptr<LSLongVector>
var sizes : ptr<LSLongVector>
Expand Down
4 changes: 2 additions & 2 deletions core/heap-analysis.stanza
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ lostanza defn class-name (x:ref<Int>) -> ref<String> :

; run gc, collect heap stats while walking each object in nursery and heap
lostanza defn do-analyze-heap (stats:ref<Vector<HeapStat>>) -> ref<Long> :
val vms:ptr<VMState> = call-prim flush-vm()
val vms:ptr<core/VMState> = call-prim flush-vm()
run-garbage-collector()
val num-classes = vms.heap-statistics.length
clear(addr(vms.heap-statistics.entries), num-classes * sizeof(HeapStatistic))
clear(addr(vms.heap-statistics.entries), num-classes * sizeof(core/HeapStatistic))
iterate-objects(vms.heap.start, vms.heap.old-objects-end, vms, addr(collect-heap-stats))
val nursery = core/nursery-start(addr(vms.heap))
iterate-objects(nursery, vms.heap.top, vms, addr(collect-heap-stats))
Expand Down

0 comments on commit 7fd0a73

Please sign in to comment.