scope_types.h dont include a const static char arr [59]; in every TU #23372
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This array is 59 bytes long, and is rounded to 64 bytes of .rdata storage. While all commercial/big FOSS CCs will correctly discard this unreferenced array during link phase (.o/.obj -> .exe/.dll). There is no reason for every TU/.o file to have this 64 byte array sitting in it. This was caused by a mistake in the initial commit of scope_types.h, when this array was moved out of scope.c to a .h.
commit 721bab5 - Yves Orton - 10/31/2022 6:37:27 AM scope_types.h - new header file for scope type data Next patch this data will be autogenerated.
To fix this, I choose instead of feature switching it behind a very narrow and "not for CPAN"
#ifdef PERL_IN_SCOPE_C
I decided for flexibility if B::Foo or Devel::Foo on CPAN in the future wants this array they can ask for it with
#define WANT_LEAVE_SCOPE_ARG_COUNTS
also reduce white space for a tiny bit faster compile times (theoretical).