summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorDaniel Dragan <bulk88@hotmail.com>2014-06-15 17:49:32 -0400
committerTony Cook <tony@develop-help.com>2014-06-24 15:30:11 +1000
commitddeaf6457db7d0d56f0cc5a6452effef1d1a0f2f (patch)
tree7e77c495dc08f1dd859592352f55e32398a3113c /util.c
parent21134f66d28b7acf8dde08e536e8b4ee120ea3af (diff)
downloadperl-ddeaf6457db7d0d56f0cc5a6452effef1d1a0f2f.tar.gz
PERL_UNUSED_CONTEXT -> remove interp context where possible
Removing context params will save machine code in the callers of these functions, and 1 ptr of stack space. Some of these funcs are heavily used as mg_find*. The contexts can always be readded in the future the same way they were removed. This patch inspired by commit dc3bf40570. Also remove PERL_UNUSED_CONTEXT when its not needed. See removal candidate rejection rational in [perl #122106]. -Perl_hv_backreferences_p uses context in S_hv_auxinit commit 96a5add60f was wrong -Perl_whichsig_sv and Perl_whichsig_pv wrongly used PERL_UNUSED_CONTEXT from inception in commit 84c7b88cca -in authors opinion cast_* shouldn't be public API, no CPAN grep usage, can't be static and/or inline optimized since it is exported -Perl_my_unexec move to block where it is needed, make Win32 block, context free, for inlining likelyhood, private api and only 2 callers in core -Perl_my_dirfd make all blocks context free, then change proto -Perl_bytes_cmp_utf8 wrongly used PERL_UNUSED_CONTEXT from inception in commit fed3ba5d6b
Diffstat (limited to 'util.c')
-rw-r--r--util.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/util.c b/util.c
index d81635d09f..f2e537be26 100644
--- a/util.c
+++ b/util.c
@@ -3617,13 +3617,12 @@ Perl_init_tm(pTHX_ struct tm *ptm) /* see mktime, strftime and asctime */
* semantics (and overhead) of mktime().
*/
void
-Perl_mini_mktime(pTHX_ struct tm *ptm)
+Perl_mini_mktime(struct tm *ptm)
{
int yearday;
int secs;
int month, mday, year, jday;
int odd_cent, odd_year;
- PERL_UNUSED_CONTEXT;
PERL_ARGS_ASSERT_MINI_MKTIME;
@@ -5390,19 +5389,17 @@ Perl_get_db_sub(pTHX_ SV **svp, CV *cv)
}
int
-Perl_my_dirfd(pTHX_ DIR * dir) {
+Perl_my_dirfd(DIR * dir) {
/* Most dirfd implementations have problems when passed NULL. */
if(!dir)
return -1;
#ifdef HAS_DIRFD
- PERL_UNUSED_CONTEXT;
return dirfd(dir);
#elif defined(HAS_DIR_DD_FD)
- PERL_UNUSED_CONTEXT;
return dir->dd_fd;
#else
- Perl_die(aTHX_ PL_no_func, "dirfd");
+ Perl_croak_nocontext(PL_no_func, "dirfd");
assert(0); /* NOT REACHED */
return 0;
#endif