summaryrefslogtreecommitdiff
path: root/sv.h
diff options
context:
space:
mode:
Diffstat (limited to 'sv.h')
-rw-r--r--sv.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/sv.h b/sv.h
index cf71f03430..869cd422b5 100644
--- a/sv.h
+++ b/sv.h
@@ -842,6 +842,18 @@ in gv.h: */
SvPV_renew(sv, _lEnGtH); \
} STMT_END
+#define SvPV_free(sv) \
+ STMT_START { assert(SvTYPE(sv) >= SVt_PV); \
+ if (SvLEN(sv)) { \
+ if(SvOOK(sv)) { \
+ Safefree(SvPVX(sv) - SvIVX(sv)); \
+ SvFLAGS(sv) &= ~SVf_OOK; \
+ } else { \
+ Safefree(SvPVX(sv)); \
+ } \
+ } \
+ } STMT_END
+
#define BmRARE(sv) ((XPVBM*) SvANY(sv))->xbm_rare
#define BmUSEFUL(sv) ((XPVBM*) SvANY(sv))->xbm_useful
#define BmPREVIOUS(sv) ((XPVBM*) SvANY(sv))->xbm_previous