X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=cv.h;h=ada2e4df3eca1d86cae26990abe276bb938a0dc9;hb=06c0cc96ebd866767a6d107ed78967600f7e0395;hp=74e2adec8d4320d061cf23506aad1a9a03b59643;hpb=4bb101f2758f169969171dfe6b70f68a406dcc1e;p=p5sagit%2Fp5-mst-13.2.git diff --git a/cv.h b/cv.h index 74e2ade..ada2e4d 100644 --- a/cv.h +++ b/cv.h @@ -1,7 +1,7 @@ /* cv.h * * Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1999, - * 2000, 2001, 2002, 2003, by Larry Wall and others + * 2000, 2001, 2002, 2003, 2004, 2005, by Larry Wall and others * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -12,11 +12,14 @@ * in sv.h */ struct xpvcv { - char * xpv_pv; /* pointer to malloced string (for prototype) */ + NV xnv_nv; /* numeric value, if any */ STRLEN xpv_cur; /* length of xp_pv as a C string */ STRLEN xpv_len; /* allocated size */ - IV xof_off; /* integer value */ - NV xnv_nv; /* numeric value, if any */ + union { + IV xivu_iv; /* integer value or pv offset */ + UV xivu_uv; + void * xivu_p1; + } xiv_u; MAGIC* xmg_magic; /* magic for scalar array */ HV* xmg_stash; /* class package */ @@ -75,7 +78,10 @@ Returns the stash of the CV. #define CVf_CLONED 0x0002 /* a clone of one of those */ #define CVf_ANON 0x0004 /* CvGV() can't be trusted */ #define CVf_OLDSTYLE 0x0008 -#define CVf_UNIQUE 0x0010 /* can't be cloned */ +#define CVf_UNIQUE 0x0010 /* sub is only called once (eg PL_main_cv, + * require, eval). Not to be confused + * with the GVf_UNIQUE flag associated + * with the :unique attribute */ #define CVf_NODEBUG 0x0020 /* no DB::sub indirection for this CV (esp. useful for special XSUBs) */ #define CVf_METHOD 0x0040 /* CV is explicitly marked as a method */ @@ -164,7 +170,7 @@ C flag in the child. This allows us to determine under what circumstances we should decrement the refcount of the parent when freeing the child. -There is a further complication with non-closure anonymous subs (ie those +There is a further complication with non-closure anonymous subs (i.e. those that do not refer to any lexicals outside that sub). In this case, the anonymous prototype is shared rather than being cloned. This has the consequence that the parent may be freed while there are still active @@ -202,3 +208,13 @@ should print 123: =cut */ + +/* + * Local variables: + * c-indentation-style: bsd + * c-basic-offset: 4 + * indent-tabs-mode: t + * End: + * + * ex: set ts=8 sts=4 sw=4 noet: + */