diff options
-rw-r--r-- | regcomp.c | 3 | ||||
-rw-r--r-- | regexp.h | 6 | ||||
-rw-r--r-- | sv.c | 15 | ||||
-rw-r--r-- | sv.h | 6 |
4 files changed, 11 insertions, 19 deletions
@@ -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); @@ -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 */ @@ -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) \ @@ -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 |