Skip to content

Commit 0f68691

Browse files
authored
corrections as to whether snap() returns absolute or relative filename
1 parent a34c01e commit 0f68691

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

doc/Type/Telemetry.rakudoc

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,22 +99,23 @@ become the value of the C<message> attribute of the new C<Telemetry> object.
9999

100100
Also from release 2019.07, one can pass a named argument C<:heap>
101101
to instruct the compiler to write a heap snapshot to a file.
102+
From release 2021.12, C<snap> returns that filename.
102103
The argument C<:heap> can be of type C<Bool>, C<Str>, or C<IO::Path>. Their implications are as follows:
103104

104105
=item C<IO::Path>, e.g. C«snap( heap => 'outputfile'.IO )»: The snapshot will be written to exactly this path.
105-
The returned filename is an absolute path.
106+
The returned filename is always an absolute path.
106107

107108
=item C<Str>, e.g. C«snap(:heap<outputfile>)»: The snapshot will be written to this path I<if> no such file already exists.
108109
If such a file already exists, the snapshot will instead be written to C<outputfile-$($*PID)-$($i).mvmheap>
109-
(where C<$i> starts at 1 and increases each time). The returned filename is a relative path.
110+
(where C<$i> starts at 1 and increases each time).
111+
The returned filename is a relative or an absolute path depending on what form C<:heap> has.
110112

111113
=item Boolean C<True>, e.g. C<snap(:heap)>: The snapshot will be written to the file C<heapsnapshot-$($*PID)-$($i).mvmheap>.
112-
The returned filename is a relative path.
114+
The returned filename is always a relative path.
113115

114-
Additionally, in each of these cases, two ordinary C<Telemetry> object are pushed to the internal array:
115-
One is object created just before writing the snapshot and has C<$message> as its C<message> attribute.
116+
Additionally, in each of these cases, two ordinary C<Telemetry> objects are pushed to the internal array:
117+
One of them is created just before writing the snapshot and has C<$message> as its C<message> attribute.
116118
The other is created just after writing the snapshot and has the filename as ith C<message> attribute.
117-
From release 2021.12, C<snap> returns that filename.
118119

119120
Finally, there's also this option for C<:heap>:
120121

0 commit comments

Comments
 (0)