This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cbae396
)
Shortcut chasing round strtab when we're not the last reference.
author
Nicholas Clark
<nick@ccl4.org>
Sun, 12 Jun 2005 21:08:33 +0000
(21:08 +0000)
committer
Nicholas Clark
<nick@ccl4.org>
Sun, 12 Jun 2005 21:08:33 +0000
(21:08 +0000)
p4raw-id: //depot/perl@24809
hv.c
patch
|
blob
|
blame
|
history
diff --git
a/hv.c
b/hv.c
index
ae67070
..
1358acd
100644
(file)
--- a/
hv.c
+++ b/
hv.c
@@
-2170,6
+2170,15
@@
S_unshare_hek_or_pvn(pTHX_ const HEK *hek, const char *str, I32 len, U32 hash)
/* Assert that the caller passed us a genuine (or at least consistent)
shared hek */
assert (he->shared_he_he.hent_hek == hek);
+
+ LOCK_STRTAB_MUTEX;
+ if (he->shared_he_he.hent_val - 1) {
+ --he->shared_he_he.hent_val;
+ UNLOCK_STRTAB_MUTEX;
+ return;
+ }
+ UNLOCK_STRTAB_MUTEX;
+
hash = HEK_HASH(hek);
} else if (len < 0) {
STRLEN tmplen = -len;