summaryrefslogtreecommitdiff
path: root/gv.h
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2006-02-25 00:39:30 +0000
committerNicholas Clark <nick@ccl4.org>2006-02-25 00:39:30 +0000
commitf7877b281b40407827939f44ea94226de573cdbc (patch)
treea9a5cac49427908841ae0bf5a3af524fee855e6a /gv.h
parentfb4fc1faf0cb0e6b2bec4f31ddbca2817f387a6e (diff)
downloadperl-f7877b281b40407827939f44ea94226de573cdbc.tar.gz
Store GvGP in the SV head union. For all the common lookups [eg GvCV()]
this avoids 1 pointer dereference and the associated risk of a CPU cache miss. Although this patch looks deceptively small, I fear its CBV(*) might be rather high. (* Crack By Volume) p4raw-id: //depot/perl@27323
Diffstat (limited to 'gv.h')
-rw-r--r--gv.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/gv.h b/gv.h
index da9da4a4fc..1e4797a192 100644
--- a/gv.h
+++ b/gv.h
@@ -31,9 +31,10 @@ struct gp {
((!defined(_MSC_VER) || _MSC_VER > 1200) && !defined(__BORLANDC__))
# define GvGP(gv) (*(assert(SvTYPE(gv) == SVt_PVGV || \
SvTYPE(gv) == SVt_PVLV), \
- &(GvXPVGV(gv)->xgv_gp)))
+ assert(isGV_with_GP(gv)), \
+ &((gv)->sv_u.svu_gp)))
#else
-# define GvGP(gv) (GvXPVGV(gv)->xgv_gp)
+# define GvGP(gv) ((gv)->sv_u.svu_gp)
#endif
#define GvNAME(gv) (GvXPVGV(gv)->xgv_name)