summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Dragan <bulk88@hotmail.com>2014-12-25 14:43:14 -0500
committerFather Chrysostomos <sprout@cpan.org>2014-12-26 17:32:59 -0800
commitc910fead7893fe9700031ee59de6b904260b5d69 (patch)
treeb6a06535fa5b2c0d61eb437166da44661ce448ce
parent2683609f0d33a1a72182223e7262a7154087539b (diff)
downloadperl-c910fead7893fe9700031ee59de6b904260b5d69.tar.gz
const the core magic vtables
A remark in http://www.nntp.perl.org/group/perl.perl5.porters/2006/07/msg115113.html caused commit bc028b6b7f / http://www.nntp.perl.org/group/perl.perl5.porters/2006/07/msg115116.html . That remark is not true according to http://www.nntp.perl.org/group/perl.perl5.porters/2006/07/msg115115.html and http://www.nntp.perl.org/group/perl.perl5.porters/2013/01/msg197318.html . To save memory between perl processes, const the tables so the memory is shared by the OS between perl processes. b4 .rdata section of x64 VC 2008 miniperl 0x667EE bytes .data 0x3440 bytes after .rdata 0x66FAE .data 0x2C80, 0x3440-0x2C80=0x7C0 saved, based on the .data section size crossing a page boundary this saved 4K of per process memory on Win64 miniperl.
-rw-r--r--perl.h9
1 files changed, 1 insertions, 8 deletions
diff --git a/perl.h b/perl.h
index ac674c1aa9..9fe2fb57f2 100644
--- a/perl.h
+++ b/perl.h
@@ -5558,14 +5558,7 @@ EXTCONST runops_proc_t PL_runops_std
EXTCONST runops_proc_t PL_runops_dbg
INIT(Perl_runops_debug);
-/* PERL_GLOBAL_STRUCT_PRIVATE wants to keep global data like the
- * magic vtables const, but this is incompatible with SWIG which
- * does want to modify the vtables. */
-#ifdef PERL_GLOBAL_STRUCT_PRIVATE
-# define EXT_MGVTBL EXTCONST MGVTBL
-#else
-# define EXT_MGVTBL EXT MGVTBL
-#endif
+#define EXT_MGVTBL EXTCONST MGVTBL
#define PERL_MAGIC_READONLY_ACCEPTABLE 0x40
#define PERL_MAGIC_VALUE_MAGIC 0x80