From 84b6ffe19e78a3f4e6f75c5ad837eb560342c389 Mon Sep 17 00:00:00 2001 From: bulk88 Date: Sun, 15 Jun 2025 05:31:21 -0400 Subject: [PATCH] scope_types.h dont include a const static char arr [59]; in every TU 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 721bab5938 - 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). --- regen/scope_types.pl | 4 +- scope.c | 1 + scope_types.h | 120 ++++++++++++++++++++++--------------------- 3 files changed, 65 insertions(+), 60 deletions(-) diff --git a/regen/scope_types.pl b/regen/scope_types.pl index a3f406951793..bc09bd84e21e 100644 --- a/regen/scope_types.pl +++ b/regen/scope_types.pl @@ -72,12 +72,13 @@ BEGIN $c_code .= <