Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable removing most of mathoms.c and stub functions #22691

Merged
merged 7 commits into from
Oct 28, 2024

Conversation

khwilliamson
Copy link
Contributor

It turns out to be pretty simple to extend embed.pl to allow macros to be easily created to replace stub functions that clutter up various of our source files. This commit does that and then uses it to replace half a dozen-ish functions of various forms.

Usually these functions are called only by someone using the long name, and for those people, it's slower. By making them macros, there's no overhead, and the binary is simplified.

  • I don't know if this set of changes requires a perldelta entry

@bulk88
Copy link
Contributor

bulk88 commented Oct 23, 2024

Good idea to trim the mathoms section. I wouldnt remove all of the mathoms, if lets say the modern API has 5 args, most of which are 0 or NULL, but the old one has 1 or 2 args. But for this branch, good idea. Nobody uses dlsym/GetProcAddress on libperl from XS. Note this branch would break XS code if someone was crazy enough to do dlsym/GetProcAddress on libperl instead of using perl's bundled headers. But nobody does that.

Prior to this commit these were illegal.

This causes embed.fnc to generate macro 'Perl_foo' #defined to be  macro
'foo'.  If the macro name is all upper case, we instead get macro
'PERL_FOO' for 'FOO'.  This could be used to easily convert existing
macros into having long names should some become a name space pollution
problem.

This also documents in embed.fnc, under the 'm' flag discussion, how to
use this instead of placing things in mathoms.c, or creating stub
functions.
This uses the new mechanism introduced in the previous commit.
This is now implemented entirely via macros
This is now entirely implemented by macros
@khwilliamson khwilliamson merged commit f2cb455 into Perl:blead Oct 28, 2024
2 checks passed
@khwilliamson khwilliamson deleted the rm_mp branch October 28, 2024 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants