@@ -99,22 +99,23 @@ become the value of the C<message> attribute of the new C<Telemetry> object.
9999
100100Also from release 2019.07, one can pass a named argument C<:heap>
101101to instruct the compiler to write a heap snapshot to a file.
102+ From release 2021.12, C<snap> returns that filename.
102103The 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.
108109If 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.
116118The 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
119120Finally, there's also this option for C<:heap>:
120121
0 commit comments