Commit 03f24b8
committed
Make croak() always expand to Perl_croak_nocontext()
Perl almost always opts for saving time over saving space. Hence, we
have croak() that saves time at the expense of space, but needs thread
context available; and croak_no_context() that doesn't need that, but
takes extra time
But, when we are about to die, time isn't that important. Even if we
are doing eval after eval in a tight loop, the potential time savings of
passing the thread context to Perl_croak is insignificant compared to
the tear-down that follows. My claim then is that croak() never needed
a thread context parameter to save a bit of time just before death. It
is an optimization that isn't worth it. And having it do so required
the invention of croak_nocontext(), and the extra cognitive load
associated with two methods for the same task.
This commit changes plain croak() to not use a thread context parameter.
It and croak_nocontext() now behave identically. That means that going
forward, people will likely choose croak() which requires less typing
and occupies fewer columns on the screen, and they won't have to
remember which form to use when.1 parent e1e4832 commit 03f24b8
6 files changed
+13
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
90 | 89 | | |
91 | 90 | | |
92 | 91 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
922 | 922 | | |
923 | 923 | | |
924 | 924 | | |
925 | | - | |
| 925 | + | |
926 | 926 | | |
927 | 927 | | |
928 | 928 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | 32 | | |
34 | 33 | | |
35 | 34 | | |
| |||
78 | 77 | | |
79 | 78 | | |
80 | 79 | | |
81 | | - | |
82 | 80 | | |
83 | 81 | | |
84 | 82 | | |
| |||
914 | 912 | | |
915 | 913 | | |
916 | 914 | | |
917 | | - | |
918 | 915 | | |
919 | 916 | | |
920 | 917 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | 44 | | |
46 | 45 | | |
47 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1912 | 1912 | | |
1913 | 1913 | | |
1914 | 1914 | | |
1915 | | - | |
1916 | | - | |
1917 | | - | |
1918 | | - | |
| 1915 | + | |
| 1916 | + | |
| 1917 | + | |
1919 | 1918 | | |
1920 | 1919 | | |
1921 | 1920 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
14 | 23 | | |
15 | 24 | | |
16 | 25 | | |
| |||
0 commit comments