perl5 icon indicating copy to clipboard operation
perl5 copied to clipboard

don't call vivifier macros Perl_error_log/Perl_debug_log in a loop

Open bulk88 opened this issue 6 months ago • 0 comments

  • macros Perl_error_log/Perl_debug_log internally call exported function PerlIO_stderr(my_perl) which may or may not call Newxz() or calloc(). A naive person would think these macros are PL_something my_perl->Isomething vars or they are C image globals vars. These 2 macros are not simple data var derefs, but are in fact vivifing function calls. Probably 20-30 years, before PerlIO was invented, I will guess Perl_error_log/Perl_debug_log where just "#define Perl_error_log 2".
  • Fix this by caching the PerlIO * ptrs to C autos.
  • Why the PerlIO API is NULL ptr, and why these vivifier function calls need to be called everywhere in all of core, at all PL_phases of execution, is beyond the scope of this commit.

  • This set of changes does not require a perldelta entry.

bulk88 avatar Jun 05 '25 10:06 bulk88