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
[PATCH] remove unreferenced copies of char * swash_property_names[] #16440
Comments
From @bulk88Created by @bulk88See attached patch. Perl Info
|
From @bulk880001-remove-unreferenced-copies-of-char-swash_property_na.patchFrom fb420d463f5404ac48060a81774694e1479ca468 Mon Sep 17 00:00:00 2001
From: Daniel Dragan <bulk88@hotmail.com>
Date: Sun, 25 Feb 2018 21:31:26 -0500
Subject: [PATCH] remove unreferenced copies of char * swash_property_names[]
Due to some MSVC bug or perl's not using MS specific CC options that I've
never figured out, MSVC does not remove unreferenced by a single .obj or
combine identical, static const data vars. MSVC funcs get removed &
combined correctly. Since for var swash_property_names removing it from
.objs that dont need it is very easy, do it. It saves some memory space.
Perhaps some other platforms/OSes/CCs have similar problems removing
unreferenced symbols from final binaries so this patch would help on those
CCs too.
regexec.c stopped using swash_property_names in commit 2a16ac9277 in 5.19.8
"regexec.c: Use compiled-in POSIX definitions"
regcomp.c stopped using swash_property_names in commit bcb875216f in 5.19.8
"regcomp.c: Rmv code for delayed 'til runtime POSIX defns"
with MSVC 2008 64, before
miniperl.exe disk file size 1761KB .rdata virtual size 0xBC354 bytes
perl527.dll disk file size 2040KB .rdata virtual size 0xC9421 bytes
after this commit
miniperl.exe disk file size 1761KB .rdata virtual size 0xBC2C4 bytes
perl527.dll disk file size 2040KB .rdata virtual size 0xC9381 bytes
~144 bytes saved by removing unused copies of swash_property_names array.
There are other cases of large duplicate static const data vars still in
the perl527.dll binary but this patch covers a very simple case.
---
handy.h | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/handy.h b/handy.h
index 12d73b9..7fe1cf6 100644
--- a/handy.h
+++ b/handy.h
@@ -1216,9 +1216,7 @@ typedef enum {
#define POSIX_SWASH_COUNT _FIRST_NON_SWASH_CC
#define POSIX_CC_COUNT (_HIGHEST_REGCOMP_DOT_H_SYNC + 1)
-#if defined(PERL_IN_UTF8_C) \
- || defined(PERL_IN_REGCOMP_C) \
- || defined(PERL_IN_REGEXEC_C)
+#if defined(PERL_IN_UTF8_C)
# if _CC_WORDCHAR != 0 || _CC_DIGIT != 1 || _CC_ALPHA != 2 || _CC_LOWER != 3 \
|| _CC_UPPER != 4 || _CC_PUNCT != 5 || _CC_PRINT != 6 \
|| _CC_ALPHANUMERIC != 7 || _CC_GRAPH != 8 || _CC_CASED != 9
--
1.8.0.msysgit.0
|
@khwilliamson - Status changed from 'new' to 'open' |
From @khwilliamsonThanks, committed as f1bfbdd |
@khwilliamson - Status changed from 'open' to 'pending release' |
From @khwilliamsonThank you for filing this report. You have helped make Perl better. With the release yesterday of Perl 5.28.0, this and 185 other issues have been Perl 5.28.0 may be downloaded via: If you find that the problem persists, feel free to reopen this ticket. |
@khwilliamson - Status changed from 'pending release' to 'resolved' |
Migrated from rt.perl.org#132912 (status was 'resolved')
Searchable as RT132912$
The text was updated successfully, but these errors were encountered: