Skip Menu |

This queue is for tickets about the Compress-Raw-Zlib CPAN distribution.

Report information
The Basics
Id: 101298
Status: resolved
Priority: 0/
Queue: Compress-Raw-Zlib

People
Owner: Nobody in particular
Requestors: BULKDD [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 2.069



Subject: [PATCH] const all global data
This patch makes Compress-Raw-Zlib use no perl caused RW static/global memory. On some OSes/CCs, this allows complete removal of the RW initialized memory section from shared library. Since this patches the bzip src code, maybe it needs to be submitted upstream. IDK if it is worth it.
Subject: 0001-const-all-global-data.patch
From 35a8a6985c51130f1e5a50cbef13986b8d3223a2 Mon Sep 17 00:00:00 2001 From: bulk88 <bulk88@hotmail.com> Date: Mon, 5 Jan 2015 03:54:05 -0500 Subject: [PATCH] const all global data --- Zlib.xs | 4 ++++ zlib-src/trees.c | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Zlib.xs b/Zlib.xs index 2eb78c0..c340332 100644 --- a/Zlib.xs +++ b/Zlib.xs @@ -274,6 +274,10 @@ static const char my_z_errmsg[][32] = { # define NO_WRITEABLE_DATA #endif +/* for efficiency, optimize trace to a constant in regular builds */ +#undef NO_WRITEABLE_DATA +#define NO_WRITEABLE_DATA + #define TRACE_DEFAULT 0 #ifdef NO_WRITEABLE_DATA diff --git a/zlib-src/trees.c b/zlib-src/trees.c index 9dbd905..622859a 100644 --- a/zlib-src/trees.c +++ b/zlib-src/trees.c @@ -122,13 +122,13 @@ struct static_tree_desc_s { int max_length; /* max bit length for the codes */ }; -local static_tree_desc static_l_desc = +local const static_tree_desc static_l_desc = {static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS}; -local static_tree_desc static_d_desc = +local const static_tree_desc static_d_desc = {static_dtree, extra_dbits, 0, D_CODES, MAX_BITS}; -local static_tree_desc static_bl_desc = +local const static_tree_desc static_bl_desc = {(const ct_data *)0, extra_blbits, 0, BL_CODES, MAX_BL_BITS}; /* =========================================================================== -- 1.7.9.msysgit.0
On Mon Jan 05 04:21:07 2015, BULKDD wrote: Show quoted text
> This patch makes Compress-Raw-Zlib use no perl caused RW static/global > memory. On some OSes/CCs, this allows complete removal of the RW > initialized memory section from shared library. Since this patches the > bzip src code, maybe it needs to be submitted upstream. IDK if it is > worth it.
Bump.
On Tue Jun 02 08:44:55 2015, BULKDD wrote: Show quoted text
> On Mon Jan 05 04:21:07 2015, BULKDD wrote:
> > This patch makes Compress-Raw-Zlib use no perl caused RW static/global > > memory. On some OSes/CCs, this allows complete removal of the RW > > initialized memory section from shared library. Since this patches the > > bzip src code, maybe it needs to be submitted upstream. IDK if it is > > worth it.
> > Bump.
Bump.
On Sat Aug 15 02:44:13 2015, BULKDD wrote: Show quoted text
> On Tue Jun 02 08:44:55 2015, BULKDD wrote:
> > On Mon Jan 05 04:21:07 2015, BULKDD wrote:
> > > This patch makes Compress-Raw-Zlib use no perl caused RW static/global > > > memory. On some OSes/CCs, this allows complete removal of the RW > > > initialized memory section from shared library. Since this patches the > > > bzip src code, maybe it needs to be submitted upstream. IDK if it is > > > worth it.
> > > > Bump.
> > Bump. >
Hey Daniel, thank's for the gentle reminders.:-) Good news on this one. The equivalent patch was applied to the official zlib source tree in August, so I have no issue with making the change. Hope to get the patch out this week. Ping me if I forget. cheers & sorry for sitting on this one for so long. Paul