-
Notifications
You must be signed in to change notification settings - Fork 587
Enable removing most of mathoms.c and stub functions #22691
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
Conversation
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 |
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
Prior to this commit, a macro that doesn't deal with thread context can have its long 'Perl_foo' name form be automatically generated. This was added in 5.41 by GH Perl#22691. I had thought it worked in all cases, but the threaded case had to be reverted by Perl#23209. The original scheme was too simplistic. This new commit reintroduces the thread context automatic handling, but isn't so naive this time. This commit will enable the emptying of much of mathoms.c, and the removal of quite a few similar functions scattered throughout the code. The next commit will convert the first such function, as a proof of concept.
Prior to this commit, a macro that doesn't deal with thread context can have its long 'Perl_foo' name form be automatically generated. This was added in 5.41 by GH #22691. I had thought it worked in all cases, but the threaded case had to be reverted by #23209. The original scheme was too simplistic. This new commit reintroduces the thread context automatic handling, but isn't so naive this time. This commit will enable the emptying of much of mathoms.c, and the removal of quite a few similar functions scattered throughout the code. The next commit will convert the first such function, as a proof of concept.
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.