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
`Perl_more_bodies` allocates and sets up a new arena for the likes of
SV body, HE, and HVAUX structs. It has traditionally been called with
three arguments:
* the `svtype`
* the size of the structs that the arena will contain
* the size of the arena to allocate
This commit changes the function definition such that it only takes
a single argument: the `svtype`. From that, and with a bit of
additional logic to account of HE and HVAUX using the indexes
notionally for SVt_NULL and SVt_IV, `Perl_more_bodies` can figure
out the sizing for itself.
The rationale for this is that:
* When an application is starting up, the need to call `Perl_more_bodies`
is the unlikely case in each new SV allocation or upgrade.
* When the application has reached a steady state, the function
may not be called regardless of how many SVs are created or upgraded.
With `Perl_newSV_type` being an inline function, there are a lot of
potential callers to this function though, each of which will have
two `mov` instructions for pushing the two size parameters onto the
stack should the need to call `Perl_more_bodies` arise. Removing two
instructions from each potential call site should help reduce binary
size a little and avoid taking up unnecessary space in the CPU's
instruction buffer.
0 commit comments