Skip to content

Commit

Permalink
Extract heap snapshotting logic into separate module
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Aug 4, 2022
1 parent 9b13a55 commit 4308a1a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/heap-snapshot.rakumod
@@ -0,0 +1,11 @@
use Perl6::Compiler:from<NQP>;

my $snapshot-idx = 1;
my sub heap-snapshot(
IO() $io = "heapsnapshot-$($*PID)-$($snapshot-idx++).mvmheap"
--> Str:D) is export {

my $filename := $io.absolute;
Perl6::Compiler.profiler-snapshot: :kind<heap>, :$filename;
$filename
}
1 change: 1 addition & 0 deletions tools/build/install-core-dist.raku
Expand Up @@ -13,6 +13,7 @@ my %provides =
"Telemetry" => "lib/Telemetry.rakumod",
"snapper" => "lib/snapper.rakumod",
"safe-snapper" => "lib/safe-snapper.rakumod",
"heap-snapshot" => "lib/heap-snapshot.rakumod",
"BUILDPLAN" => "lib/BUILDPLAN.rakumod",
;

Expand Down

0 comments on commit 4308a1a

Please sign in to comment.