Commit ab5cc99
committed
Perl_more_bodies - figure out sizing from sv_type
`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.1 parent df4834b commit ab5cc99
5 files changed
+29
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2043 | 2043 | | |
2044 | 2044 | | |
2045 | 2045 | | |
2046 | | - | |
2047 | | - | |
2048 | | - | |
| 2046 | + | |
2049 | 2047 | | |
2050 | 2048 | | |
2051 | 2049 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
162 | | - | |
| 162 | + | |
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
856 | 856 | | |
857 | 857 | | |
858 | 858 | | |
859 | | - | |
860 | | - | |
| 859 | + | |
861 | 860 | | |
862 | 861 | | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
863 | 873 | | |
864 | 874 | | |
865 | 875 | | |
| |||
1291 | 1301 | | |
1292 | 1302 | | |
1293 | 1303 | | |
1294 | | - | |
| 1304 | + | |
1295 | 1305 | | |
1296 | 1306 | | |
1297 | 1307 | | |
| |||
14799 | 14809 | | |
14800 | 14810 | | |
14801 | 14811 | | |
14802 | | - | |
| 14812 | + | |
14803 | 14813 | | |
14804 | 14814 | | |
14805 | 14815 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
183 | 191 | | |
184 | 192 | | |
185 | 193 | | |
| |||
328 | 336 | | |
329 | 337 | | |
330 | 338 | | |
331 | | - | |
| 339 | + | |
332 | 340 | | |
333 | 341 | | |
334 | 342 | | |
335 | | - | |
336 | | - | |
337 | | - | |
| 343 | + | |
338 | 344 | | |
339 | 345 | | |
340 | 346 | | |
341 | 347 | | |
342 | 348 | | |
343 | 349 | | |
344 | 350 | | |
345 | | - | |
| 351 | + | |
346 | 352 | | |
347 | 353 | | |
348 | 354 | | |
| |||
351 | 357 | | |
352 | 358 | | |
353 | 359 | | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | 360 | | |
363 | 361 | | |
364 | 362 | | |
| |||
381 | 379 | | |
382 | 380 | | |
383 | 381 | | |
| 382 | + | |
384 | 383 | | |
385 | 384 | | |
386 | 385 | | |
| |||
0 commit comments