From: Nicholas Clark Date: Mon, 18 Apr 2005 22:31:48 +0000 (+0000) Subject: PERL_DEBUG_COW for SvUVX and SvPVX X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=379d1ffd1cdc48dce48686458f3153f5dd29f323;p=p5sagit%2Fp5-mst-13.2.git PERL_DEBUG_COW for SvUVX and SvPVX p4raw-id: //depot/perl@24246 --- diff --git a/ext/DynaLoader/dl_dyld.xs b/ext/DynaLoader/dl_dyld.xs index d719951..ef96b48 100644 --- a/ext/DynaLoader/dl_dyld.xs +++ b/ext/DynaLoader/dl_dyld.xs @@ -97,8 +97,7 @@ static void TranslateError path, number, type); break; } - safefree(dl_last_error); - dl_last_error = savepv(error); + sv_setpv(MY_CXT.x_dl_last_error, error); } static char *dlopen(char *path, int mode /* mode is ignored */) diff --git a/sv.h b/sv.h index b90d209..251a1d9 100644 --- a/sv.h +++ b/sv.h @@ -738,14 +738,15 @@ in gv.h: */ #ifdef PERL_DEBUG_COW #define SvIVX(sv) (0 + ((XPVIV*) SvANY(sv))->xiv_iv) -#define SvUVX(sv) ((XPVUV*) SvANY(sv))->xuv_uv +#define SvUVX(sv) (0 + (XPVUV*) SvANY(sv))->xuv_uv #define SvNVX(sv) (0.0 + ((XPVNV*)SvANY(sv))->xnv_nv) +#define SvPVX(sv) (0 + ((XPV*) SvANY(sv))->xpv_pv) #else #define SvIVX(sv) ((XPVIV*) SvANY(sv))->xiv_iv #define SvUVX(sv) ((XPVUV*) SvANY(sv))->xuv_uv #define SvNVX(sv) ((XPVNV*)SvANY(sv))->xnv_nv +#define SvPVX(sv) ((XPV*) SvANY(sv))->xpv_pv #endif -#define SvPVX(sv) ((XPV*) SvANY(sv))->xpv_pv #define SvCUR(sv) ((XPV*) SvANY(sv))->xpv_cur #define SvLEN(sv) ((XPV*) SvANY(sv))->xpv_len #define SvEND(sv)(((XPV*) SvANY(sv))->xpv_pv + ((XPV*)SvANY(sv))->xpv_cur) @@ -779,7 +780,7 @@ in gv.h: */ (((XPVNV*)SvANY(sv))->xnv_nv = (val)); } STMT_END #define SvPV_set(sv, val) \ STMT_START { assert(SvTYPE(sv) >= SVt_PV); \ - (SvPVX(sv) = (val)); } STMT_END + (((XPV*) SvANY(sv))->xpv_pv = (val)); } STMT_END #define SvUV_set(sv, val) \ STMT_START { assert(SvTYPE(sv) == SVt_IV || SvTYPE(sv) >= SVt_PVIV); \ (((XPVUV*)SvANY(sv))->xuv_uv = (val)); } STMT_END