summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--regcomp.c3
-rw-r--r--regexp.h6
-rw-r--r--sv.c15
-rw-r--r--sv.h6
4 files changed, 11 insertions, 19 deletions
diff --git a/regcomp.c b/regcomp.c
index 50b0632529..22c02c82ad 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -9452,7 +9452,8 @@ Perl_reg_temp_copy (pTHX_ REGEXP *rx)
a case of zero-ing that, rather than copying the current length. */
SvPV_set(ret_x, RX_WRAPPED(rx));
SvFLAGS(ret_x) |= SvFLAGS(rx) & (SVf_POK|SVp_POK|SVf_UTF8);
- StructCopy(&(r->xpv_cur), &(ret->xpv_cur), struct regexp_allocated);
+ memcpy(&(ret->xpv_cur), &(r->xpv_cur),
+ sizeof(regexp) - STRUCT_OFFSET(regexp, xpv_cur));
SvLEN_set(ret_x, 0);
Newx(ret->offs, npar, regexp_paren_pair);
Copy(r->offs, ret->offs, npar, regexp_paren_pair);
diff --git a/regexp.h b/regexp.h
index e8a8cc0d5c..fe671425d8 100644
--- a/regexp.h
+++ b/regexp.h
@@ -107,12 +107,6 @@ typedef struct regexp {
_REGEXP_COMMON;
} regexp;
-struct regexp_allocated {
- _XPV_ALLOCATED_HEAD;
- _XPVMG_HEAD;
- _REGEXP_COMMON;
-};
-
/* HV *paren_names; Optional hash of paren names
now stored in the IV union */
diff --git a/sv.c b/sv.c
index 4699a4e283..76fd6e443a 100644
--- a/sv.c
+++ b/sv.c
@@ -975,10 +975,11 @@ static const struct body_details bodies_by_type[] = {
HASARENA, FIT_ARENA(0, sizeof(XPVMG)) },
/* something big */
- { sizeof(struct regexp_allocated), sizeof(struct regexp_allocated),
- + relative_STRUCT_OFFSET(struct regexp_allocated, regexp, xpv_cur),
+ { sizeof(regexp) - STRUCT_OFFSET(regexp, xpv_cur),
+ sizeof(regexp) - STRUCT_OFFSET(regexp, xpv_cur),
+ + STRUCT_OFFSET(regexp, xpv_cur),
SVt_REGEXP, FALSE, NONV, HASARENA,
- FIT_ARENA(0, sizeof(struct regexp_allocated))
+ FIT_ARENA(0, sizeof(regexp) - STRUCT_OFFSET(regexp, xpv_cur))
},
/* 48 */
@@ -1011,9 +1012,11 @@ static const struct body_details bodies_by_type[] = {
SVt_PVFM, TRUE, NONV, NOARENA, FIT_ARENA(20, sizeof(xpvfm_allocated)) },
/* XPVIO is 84 bytes, fits 48x */
- { sizeof(xpvio_allocated), sizeof(xpvio_allocated),
- + relative_STRUCT_OFFSET(xpvio_allocated, XPVIO, xpv_cur),
- SVt_PVIO, TRUE, NONV, HASARENA, FIT_ARENA(24, sizeof(xpvio_allocated)) },
+ { sizeof(XPVIO) - STRUCT_OFFSET(XPVIO, xpv_cur),
+ sizeof(XPVIO) - STRUCT_OFFSET(XPVIO, xpv_cur),
+ + STRUCT_OFFSET(XPVIO, xpv_cur),
+ SVt_PVIO, TRUE, NONV, HASARENA,
+ FIT_ARENA(24, sizeof(XPVIO) - STRUCT_OFFSET(XPVIO, xpv_cur)) },
};
#define new_body_type(sv_type) \
diff --git a/sv.h b/sv.h
index b10843e4f3..0d275d25cf 100644
--- a/sv.h
+++ b/sv.h
@@ -567,12 +567,6 @@ struct xpvio {
_XPVIO_TAIL;
};
-typedef struct {
- _XPV_ALLOCATED_HEAD;
- _XPVMG_HEAD;
- _XPVIO_TAIL;
-} xpvio_allocated;
-
#define xio_dirp xio_dirpu.xiou_dirp
#define xio_any xio_dirpu.xiou_any