summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2020-09-07 09:27:28 -0600
committerKarl Williamson <khw@cpan.org>2020-09-29 22:37:24 -0600
commit4559f7e6350cb49ddd0cd4ae3df3db012693f220 (patch)
tree7feadcea469e19d6391d5c090f5fb2b7ae302c19 /util.c
parent59892837454d0ca367c3f7c83b2a646c57333b9a (diff)
downloadperl-4559f7e6350cb49ddd0cd4ae3df3db012693f220.tar.gz
perlapi: croak_nocontext is preferred over plain croak
When you are about to die, the time/space tradeoff may tilt towards space.
Diffstat (limited to 'util.c')
-rw-r--r--util.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/util.c b/util.c
index f54159e821..a03c54e840 100644
--- a/util.c
+++ b/util.c
@@ -1873,8 +1873,9 @@ or build an error message in an SV yourself, it is preferable to use
the C<L</croak_sv>> function, which does not involve clobbering C<ERRSV>.
The two forms differ only in that C<croak_nocontext> does not take a thread
-context (C<aTHX>) parameter, so is used in situations where the caller doesn't
-already have the thread context.
+context (C<aTHX>) parameter. It is usually preferred as it takes up fewer
+bytes of code than plain C<Perl_croak>, and time is rarely a critical resource
+when you are about to throw an exception.
=cut
*/