develooper Front page | perl.perl5.porters | Postings from October 2014

Any empty members in struct xpvcv AKA CV that an XSUB can use?

Thread Next
From:
bulk88
Date:
October 21, 2014 11:49
Subject:
Any empty members in struct xpvcv AKA CV that an XSUB can use?
Message ID:
BLU436-SMTP92B6BA5A07490F97095618DF940@phx.gbl
Id like to know if there is a 2nd unused memeber in struct xpvcv. I know 
that  union xcv_start_u  that has "OP *    xcv_start;" also has the very 
awesome "ANY    xcv_xsubany;" which is used by ParseXS and manually by 
me in CPAN code. "union xcv_root_u;" contains the xsub's C func pointer 
so that is occupied. What about     PADLIST *    xcv_padlist; as a 2nd 
ununused member for XSUBs in struct xpvcv? I'd rather not resort to 
magic to add a 2nd magic value to a CV * if I dont have to.



#define _XPVCV_COMMON                                \
    HV *    xcv_stash;                            \
    union {                                    \
    OP *    xcv_start;                            \
    ANY    xcv_xsubany;                            \
    }        xcv_start_u;                                \
    union {                                    \
    OP *    xcv_root;                            \
    void    (*xcv_xsub) (pTHX_ CV*);                    \
    }        xcv_root_u;                            \
    union {                                \
    GV *    xcv_gv;                            \
    HEK *    xcv_hek;                        \
    }        xcv_gv_u;                        \
    char *    xcv_file;                            \
    PADLIST *    xcv_padlist;                            \
    CV *    xcv_outside;                            \
    U32        xcv_outside_seq; /* the COP sequence (at the point of 
our    \
                  * compilation) in the lexically enclosing    \
                  * sub */                    \
    cv_flags_t    xcv_flags;                        \
    I32    xcv_depth    /* >= 2 indicates recursive call */

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About