From: Vincent Pit Date: Sat, 4 Jul 2009 10:46:04 +0000 (+0200) Subject: Decide to use shared op info according to MULTIPLICITY X-Git-Tag: v0.08~5 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FLexical-Types.git;a=commitdiff_plain;h=cee3105da7f14fb65d736d945f2d9f948da68e92 Decide to use shared op info according to MULTIPLICITY And not LT_MULTIPLICITY, since it can be disabled at configure time. --- diff --git a/Types.xs b/Types.xs index a01cc15..a560b2d 100644 --- a/Types.xs +++ b/Types.xs @@ -319,14 +319,14 @@ STATIC perl_mutex lt_op_map_mutex; #endif typedef struct { -#if LT_MULTIPLICITY +#ifdef MULTIPLICITY STRLEN buf_size, orig_pkg_len, type_pkg_len, type_meth_len; char *buf; -#else /* LT_MULTIPLICITY */ +#else /* MULTIPLICITY */ SV *orig_pkg; SV *type_pkg; SV *type_meth; -#endif /* !LT_MULTIPLICITY */ +#endif /* !MULTIPLICITY */ OP *(*pp_padsv)(pTHX); } lt_op_info; @@ -341,18 +341,18 @@ STATIC void lt_map_store(pPTBLMS_ const OP *o, SV *orig_pkg, SV *type_pkg, SV *t if (!(oi = ptable_fetch(lt_op_map, o))) { oi = PerlMemShared_malloc(sizeof *oi); ptable_map_store(lt_op_map, o, oi); -#if LT_MULTIPLICITY +#ifdef MULTIPLICITY oi->buf = NULL; oi->buf_size = 0; -#else /* LT_MULTIPLICITY */ +#else /* MULTIPLICITY */ } else { SvREFCNT_dec(oi->orig_pkg); SvREFCNT_dec(oi->type_pkg); SvREFCNT_dec(oi->type_meth); -#endif /* !LT_MULTIPLICITY */ +#endif /* !MULTIPLICITY */ } -#if LT_MULTIPLICITY +#ifdef MULTIPLICITY { STRLEN op_len = SvCUR(orig_pkg); STRLEN tp_len = SvCUR(type_pkg); @@ -374,11 +374,11 @@ STATIC void lt_map_store(pPTBLMS_ const OP *o, SV *orig_pkg, SV *type_pkg, SV *t oi->type_pkg_len = tp_len; oi->type_meth_len = tm_len; } -#else /* LT_MULTIPLICITY */ +#else /* MULTIPLICITY */ oi->orig_pkg = orig_pkg; oi->type_pkg = type_pkg; oi->type_meth = type_meth; -#endif /* !LT_MULTIPLICITY */ +#endif /* !MULTIPLICITY */ oi->pp_padsv = pp_padsv; @@ -439,7 +439,7 @@ STATIC OP *lt_pp_padsv(pTHX) { ENTER; SAVETMPS; -#if LT_MULTIPLICITY +#ifdef MULTIPLICITY { STRLEN op_len = oi.orig_pkg_len, tp_len = oi.type_pkg_len; char *buf = oi.buf; @@ -452,11 +452,11 @@ STATIC OP *lt_pp_padsv(pTHX) { type_meth = sv_2mortal(newSVpvn(buf, oi.type_meth_len)); SvREADONLY_on(type_meth); } -#else /* LT_MULTIPLICITY */ +#else /* MULTIPLICITY */ orig_pkg = oi.orig_pkg; type_pkg = oi.type_pkg; type_meth = oi.type_meth; -#endif /* !LT_MULTIPLICITY */ +#endif /* !MULTIPLICITY */ PUSHMARK(SP); EXTEND(SP, 3);