summaryrefslogtreecommitdiff
path: root/hv.h
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-06-12 21:59:34 +0000
committerNicholas Clark <nick@ccl4.org>2005-06-12 21:59:34 +0000
commitd1db91c62f7fa6ddc9f9a29f5ba20b5d381c9d4b (patch)
tree5b501a2c81e5c3f59ef23bb9d625bcfe6f2bd652 /hv.h
parent6c1b96a17296a211cb3d88901a67369582176a79 (diff)
downloadperl-d1db91c62f7fa6ddc9f9a29f5ba20b5d381c9d4b.tar.gz
Provide share_hek_hek, and use it for fast copying of shared string
scalars. p4raw-id: //depot/perl@24811
Diffstat (limited to 'hv.h')
-rw-r--r--hv.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/hv.h b/hv.h
index ac4bdd33c8..6378a02f3b 100644
--- a/hv.h
+++ b/hv.h
@@ -364,6 +364,13 @@ C<SV*>.
#define Perl_sharepvn(sv, len, hash) HEK_KEY(share_hek(sv, len, hash))
#define sharepvn(sv, len, hash) Perl_sharepvn(sv, len, hash)
+#define share_hek_hek(hek) \
+ (++(((struct shared_he *)(((char *)hek) \
+ - STRUCT_OFFSET(struct shared_he, \
+ shared_he_hek))) \
+ ->shared_he_he.hent_val), \
+ hek)
+
/*
* Local variables:
* c-indentation-style: bsd