In perl.git, the branch yves/strtab_cleanups has been created
<http://perl5.git.perl.org/perl.git/commitdiff/57a0f1855b4c5ae6a24ed869614c82a71bafc288?hp=0000000000000000000000000000000000000000>
at 57a0f1855b4c5ae6a24ed869614c82a71bafc288 (commit)
- Log -----------------------------------------------------------------
commit 57a0f1855b4c5ae6a24ed869614c82a71bafc288
Author: Yves Orton <[email protected]>
Date: Mon May 19 10:23:59 2014 +0200
Add tests for WASUTF8 in XS-APItest
M ext/XS-APItest/t/hash.t
commit f7cae8a65159c19398c35e7438bc6661b867a3a6
Author: Yves Orton <[email protected]>
Date: Mon May 19 08:20:48 2014 +0200
in the share_hek logic test flags before testing strings
Normally we test the flags after as the flag check rarely fires. However
in PL_strtab certain rules are a little different, and we have a higher
chance
of collissions, so we check the flag first.
Also commented out the various places we do this so people dont wonder
about the discrepancy in the future.
M hv.c
commit 25e4236f329f9a1181087e5499ad761eb995900f
Author: Yves Orton <[email protected]>
Date: Sun May 18 21:53:14 2014 +0200
When we share a refcounted_he_hek() we should mask off most of the flags
The refcounted_he flags and the normal HE flags overlap for the low
bits, but not the rest.
Perl_refcounted_he_new_pvn sets up hekflags with the flags required for
refcounted_he's. It then passes it into S_share_hek_flags(), which then
uses it in the comparisons for the lookup in PL_strtab.
This results in one entry per type, and since each entry has the same
hash value produces a collision "attack" on the bucket, which could
produce something like 6 * 2 collisions in a bucket worst case (although
there is no evidence of anything this extreme).
This appears to be unnecessary, as we store the hekflags in the
refcounted entry independently of the HEK.
Therefore we mask off the bits we care about, which dedupe the HEKs
in the string table. We still get collissions for WASUTF8 and
NON-WASUTF8, but for now it will do.
M hv.c
M hv.h
commit 502fea760108f961f6e0eb1e864644588749fb21
Author: Yves Orton <[email protected]>
Date: Sun May 18 21:50:58 2014 +0200
Move comment next to code it relates to, and add a note
Apparently we don't keep track of fill in PL_strtab. This
makes sense, as fill isn't used by the internals. Just by
scalar(%hash) [ which arguably is non-ideal and should be changed ]
M hv.c
commit 007d71fa4b3a4d1fd0eaf3ea300d309bfbb38f18
Author: Yves Orton <[email protected]>
Date: Sun May 18 21:49:48 2014 +0200
reformat related defines so they line up
M hv.h
commit 0355d3572dbc4b10c71dc79a01ed9f344845a6e5
Author: Yves Orton <[email protected]>
Date: Sun May 18 21:46:23 2014 +0200
use newSVhek() to create the key SV
It does all the right things, and the code it replaces doesn't.
(Close, but not quite right.)
M ext/Hash-Util/Util.xs
-----------------------------------------------------------------------
--
Perl5 Master Repository