Change 27231 by [EMAIL PROTECTED] on 2006/02/19 22:35:24

        Shave sizeof(NV) bytes from formats, by using the same offset
        manoeuvre as PVs, PVIVs, PVAVs and PVHVs.

Affected files ...

... //depot/perl/sv.c#1148 edit
... //depot/perl/sv.h#241 edit

Differences ...

==== //depot/perl/sv.c#1148 (text) ====
Index: perl/sv.c
--- perl/sv.c#1147~27228~       2006-02-19 10:57:35.000000000 -0800
+++ perl/sv.c   2006-02-19 14:35:24.000000000 -0800
@@ -973,9 +973,11 @@
     { sizeof(XPVCV), sizeof(XPVCV), 0, TRUE, HADNV,
       HASARENA, FIT_ARENA(0, sizeof(XPVCV)) },
 
-    /* XPVFM is 80 bytes, fits 51x */
-    { sizeof(XPVFM), sizeof(XPVFM), 0, TRUE, HADNV, 
-      HASARENA, FIT_ARENA(20, sizeof(XPVFM)) },
+    { sizeof(xpvfm_allocated),
+      sizeof(xpvfm_allocated)
+      - relative_STRUCT_OFFSET(xpvfm_allocated, XPVFM, xpv_cur),
+      + relative_STRUCT_OFFSET(xpvfm_allocated, XPVFM, xpv_cur),
+      TRUE, HADNV, NOARENA, FIT_ARENA(20, sizeof(xpvfm_allocated)) },
 
     /* XPVIO is 84 bytes, fits 48x */
     { sizeof(XPVIO), sizeof(XPVIO), 0, TRUE, HADNV,

==== //depot/perl/sv.h#241 (text) ====
Index: perl/sv.h
--- perl/sv.h#240~27230~        2006-02-19 12:30:24.000000000 -0800
+++ perl/sv.h   2006-02-19 14:35:24.000000000 -0800
@@ -446,6 +446,34 @@
     IV         xfm_lines;
 };
 
+typedef struct {
+    STRLEN     xpv_cur;        /* length of svu_pv as a C string */
+    STRLEN     xpv_len;        /* allocated size */
+    union {
+       IV      xivu_iv;        /* integer value or pv offset */
+       UV      xivu_uv;
+       void *  xivu_p1;
+    }          xiv_u;
+    MAGIC*     xmg_magic;      /* linked list of magicalness */
+    HV*                xmg_stash;      /* class package */
+
+    HV *       xcv_stash;
+    OP *       xcv_start;
+    OP *       xcv_root;
+    void      (*xcv_xsub)(pTHX_ CV*);
+    ANY                xcv_xsubany;
+    GV *       xcv_gv;
+    char *     xcv_file;
+    long       xcv_depth;      /* >= 2 indicates recursive call */
+    AV *       xcv_padlist;
+    CV *       xcv_outside;
+    cv_flags_t xcv_flags;
+    U32                xcv_outside_seq; /* the COP sequence (at the point of 
our
+                                 * compilation) in the lexically enclosing
+                                 * sub */
+    IV         xfm_lines;
+} xpvfm_allocated;
+
 struct xpvio {
     NV         xnv_nv;         /* numeric value, if any */
     STRLEN     xpv_cur;        /* length of svu_pv as a C string */
@@ -923,6 +951,7 @@
            assert(SvTYPE(_svi) == SVt_NV || SvTYPE(_svi) >= SVt_PVNV); \
            assert(SvTYPE(_svi) != SVt_PVAV);                           \
            assert(SvTYPE(_svi) != SVt_PVHV);                           \
+           assert(SvTYPE(_svi) != SVt_PVFM);                           \
           &(((XPVNV*) SvANY(_svi))->xnv_nv);                           \
         }))
 #    define SvMAGIC(sv)                                                        
\
End of Patch.

Reply via email to