mirror of
https://github.com/Perl/perl5.git
synced 2026-01-26 00:27:57 +00:00
Make die() always expand to Perl_die_nocontext()
See 03f24b8a082948e5b437394fa33d0af08d7b80b6 for the motivation. This commit changes plain die() to not use a thread context parameter. It and die_nocontext() now behave identically.
This commit is contained in:
parent
e6d5a81fed
commit
c14d142701
@ -87,7 +87,6 @@ my $item_flags_re = qr/[dD fF mM nN oO pT uU Wx;]/xx;
|
||||
# This is a copy of the list in regen/embed.pl.
|
||||
my @have_compatibility_macros = qw(
|
||||
deb
|
||||
die
|
||||
form
|
||||
load_module
|
||||
mess
|
||||
|
||||
@ -1029,7 +1029,7 @@ ETXdp |char * |delimcpy_no_escape \
|
||||
|const int delim \
|
||||
|NN I32 *retlen
|
||||
Cp |void |despatch_signals
|
||||
Adfpr |OP * |die |NULLOK const char *pat \
|
||||
AMdfpr |OP * |die |NULLOK const char *pat \
|
||||
|...
|
||||
Adpr |OP * |die_sv |NN SV *baseex
|
||||
: Used in util.c
|
||||
|
||||
3
embed.h
3
embed.h
@ -30,7 +30,6 @@
|
||||
#if !defined(MULTIPLICITY)
|
||||
/* undefined symbols, point them back at the usual ones */
|
||||
# define Perl_deb_nocontext Perl_deb
|
||||
# define Perl_die_nocontext Perl_die
|
||||
# define Perl_form_nocontext Perl_form
|
||||
# define Perl_load_module_nocontext Perl_load_module
|
||||
# define Perl_mess_nocontext Perl_mess
|
||||
@ -78,7 +77,6 @@
|
||||
# if defined(MULTIPLICITY) && !defined(PERL_NO_SHORT_NAMES) && \
|
||||
!defined(PERL_WANT_VARARGS)
|
||||
# define deb Perl_deb_nocontext
|
||||
# define die Perl_die_nocontext
|
||||
# define form Perl_form_nocontext
|
||||
# define load_module Perl_load_module_nocontext
|
||||
# define mess Perl_mess_nocontext
|
||||
@ -914,7 +912,6 @@
|
||||
# if !defined(MULTIPLICITY) || defined(PERL_CORE) || \
|
||||
defined(PERL_WANT_VARARGS)
|
||||
# define deb(...) Perl_deb(aTHX_ __VA_ARGS__)
|
||||
# define die(...) Perl_die(aTHX_ __VA_ARGS__)
|
||||
# define form(...) Perl_form(aTHX_ __VA_ARGS__)
|
||||
# define load_module(a,b,...) Perl_load_module(aTHX_ a,b,__VA_ARGS__)
|
||||
# define mess(...) Perl_mess(aTHX_ __VA_ARGS__)
|
||||
|
||||
@ -42,7 +42,6 @@ BEGIN {
|
||||
# to never happen, so not worth coding automatic synchronization.
|
||||
my @have_compatibility_macros = qw(
|
||||
deb
|
||||
die
|
||||
form
|
||||
load_module
|
||||
mess
|
||||
|
||||
6
util.c
6
util.c
@ -1787,9 +1787,9 @@ These behave the same as L</croak>, except for the return type.
|
||||
They should be used only where the C<OP *> return type is required.
|
||||
They never actually return.
|
||||
|
||||
The two forms differ only in that C<die_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.
|
||||
The reasons for the existence of C<die_nocontext> are no longer applicable.
|
||||
die() can now be used in all circumstances. C<Perl_die_nocontext> might be
|
||||
useful when compiling with C<PERL_NO_SHORT_NAMES>.
|
||||
|
||||
=cut
|
||||
*/
|
||||
|
||||
10
util.h
10
util.h
@ -11,14 +11,16 @@
|
||||
#ifndef PERL_UTIL_H_
|
||||
#define PERL_UTIL_H_
|
||||
|
||||
/* Calling Perl_croak_nocontext instead of plain Perl_croak is one less
|
||||
* argument to pass under threads, so each instance takes up fewer bytes (but
|
||||
* the nocontext function has to derive the thread context itself, taking more
|
||||
* time). We trade time for less space here, because time is rarely a
|
||||
/* Calling Perl_(croak|die)_nocontext instead of plain Perl_(croak|die) is one
|
||||
* less argument to pass under threads, so each instance takes up fewer bytes
|
||||
* (but the nocontext function has to derive the thread context itself, taking
|
||||
* more time). We trade time for less space here, because time is rarely a
|
||||
* critical resource when you are about to throw an exception. */
|
||||
#define croak(...) Perl_croak_nocontext(__VA_ARGS__)
|
||||
#define die(...) Perl_die_nocontext(__VA_ARGS__)
|
||||
#ifndef MULTIPLICITY
|
||||
# define Perl_croak_nocontext Perl_croak
|
||||
# define Perl_die_nocontext Perl_die
|
||||
#endif
|
||||
|
||||
#ifdef VMS
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user