optimize/cleanup generate_uudmap.c #22651
Open
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.
See patch decriptions, fputc() is very unwise CPU wise. Original intent was to put all 3 output .h files in stack array buffers, but it was impossible to get sanely get mg_data.h under 4096 bytes, so I stopped after eliminating the worst FD I/O calls (putch()) and outputting ~80-100 byte lines is better. Full "mimifying" mg_data.h got it ~3700 bytes for me, but that is unreadable. After this patch mg_data is 4.3KB. 4096 byte boundary is artificial picked, since rumors on Google say some POSIX OSes require root/rlimit/cgroups/faux-sudo/ writing "/proc" and magic compiler flags, if you want > 8KB C stacks. Therefore, don't crash "so early", and defer the crash risk much later, to Configure or Makefile.SH or perl.bin crashing, not generate_uudmap.bin.
Also a benefit is stripping pointless ", 0, 0, 0}"s, less work for CC.
This is branched out into this pull, since major problems in sv_inline.h is another topic. Not sure if I will actually need a pre-perl generated .h or not to fix that, but I need the provisions at minimum.