diff options
author | Nicholas Clark <nick@ccl4.org> | 2006-02-25 00:39:30 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2006-02-25 00:39:30 +0000 |
commit | f7877b281b40407827939f44ea94226de573cdbc (patch) | |
tree | a9a5cac49427908841ae0bf5a3af524fee855e6a /gv.h | |
parent | fb4fc1faf0cb0e6b2bec4f31ddbca2817f387a6e (diff) | |
download | perl-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.h | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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) |