From a84d3d5affc6dd8190612862b9d5e2b60e0c584f Mon Sep 17 00:00:00 2001 From: Daniel Dragan Date: Sun, 4 Jan 2015 23:37:58 -0500 Subject: const the custom op struct in Devel::Peek This makes the Devel::Peek shared library free of perl caused RW static data vars, and if CC/OS platform allows, removes RW data section from the shared library. --- ext/Devel-Peek/Peek.pm | 2 +- ext/Devel-Peek/Peek.xs | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'ext/Devel-Peek') diff --git a/ext/Devel-Peek/Peek.pm b/ext/Devel-Peek/Peek.pm index 8f429b43b9..f3adcfc1cd 100644 --- a/ext/Devel-Peek/Peek.pm +++ b/ext/Devel-Peek/Peek.pm @@ -3,7 +3,7 @@ package Devel::Peek; -$VERSION = '1.20'; +$VERSION = '1.21'; $XS_VERSION = $VERSION; $VERSION = eval $VERSION; diff --git a/ext/Devel-Peek/Peek.xs b/ext/Devel-Peek/Peek.xs index 7e64edeee9..856ff773a1 100644 --- a/ext/Devel-Peek/Peek.xs +++ b/ext/Devel-Peek/Peek.xs @@ -406,7 +406,13 @@ S_ck_dump(pTHX_ OP *entersubop, GV *namegv, SV *cv) return (OP *)newop; } -static XOP my_xop; +const static XOP my_xop = { + XOPf_xop_name|XOPf_xop_desc|XOPf_xop_class, /* xop_flags */ + "Devel_Peek_Dump", /* xop_name */ + "Dump", /* xop_desc */ + OA_BINOP, /* xop_class */ + NULL /* xop_peep */ +}; MODULE = Devel::Peek PACKAGE = Devel::Peek @@ -439,10 +445,6 @@ BOOT: CV * const cv = get_cvn_flags("Devel::Peek::Dump", 17, 0); assert(cv); cv_set_call_checker(cv, S_ck_dump, (SV *)cv); - - XopENTRY_set(&my_xop, xop_name, "Devel_Peek_Dump"); - XopENTRY_set(&my_xop, xop_desc, "Dump"); - XopENTRY_set(&my_xop, xop_class, OA_BINOP); Perl_custom_op_register(aTHX_ S_pp_dump, &my_xop); } -- cgit v1.2.1