You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
op.c: slim down const_av_xsub const_sv_xsub XSUB.h: add GetXSTARG()
-don't use XSRETURN() macros, they use "unit of 1" relative offset "ax"
and constantly reread global my_parl->Istack_base and constant rescale
ax from unit of 1 to unit of 4/8
-don't use ST() macros for the same reason
-in const_sv_xsub() use XSTARG if its available, but just put our long
life SV* right on the PL stack if we can't write directly into the
caller lval SV*. Don't do "sv_setsv(sv_newmortal(), ssv);" on missing
XSTARG branch. Don't use dXSTARG; 50% chance there will be a 2nd!!!
secret "sv_setsv(sv_newmortal(),rval)" or "newSVsv(rval)" right after
this XSUB anyways, so just pass our SV* on stack instead of TWO
"sv_setsv(sv_newmortal(), ssv);" statements executing in a row.
const_av_xsub():
-if we will croak, do it ASAP once the minimum amount of data has been
read from global memory, AV* is delivered through C function argument
CV* cv, its not from the PL stack. So do the check and execute the
no return before creating/reading/writing a ton of PL stack related
global vars and C auto vars.
-GetXSTARG() and GIMME_V() both dig inside PL_op, keep them together w/o
any func calls in between such as EXTEND() so the CC can read OP* stored
in PL_op only once
-break apart Copy()'s overflow bounds checks so we can write a new "length"
to global state before copying the large in bytes array, historically
Perl has issues with letting PP end users code to keep running for severe
overflows/heap corruption/CVE type stuff, eval{}, %SIG, tied, MG,
sub END, etc. So do the asserts early before the actual memcpy or PUTBACK.
-handle an empty/0 elems long AV* better, don't EXTEND(0), don't call
extern libc memcpy with 0 size
-don't keep re-reading the AV head and AV body and AvFILLp(av) over and
over, func calls EXTEND() and memcpy() won't realloc the AV body ptr or
modify the AvFILL member in the body struct
XSUB.h:
-add a version of dXSTARG where the user handles what to do, if parent
frame didn't supply a SV* TARG for lval filling. This gets rid of the
inefficient sv_newmortal() that is forced on users when there almost
always better faster recipie of how to create a 0, 1, or G_LIST PL
stack retval. &PL_sv_undef, newSVpvn_flags(SVs_TEMP),
sv_2mortal(newSViv()), return your hash key's value SV* directly, etc.
Macro undocumented until further notice, so it can gather some unofficial
usage/CORE usage and some opinions regarding is it good or flawed.
0 commit comments