rurban / perl-compiler

B::C - Moved over from googlecode
https://code.google.com/p/perl-compiler/
Other
63 stars 23 forks source link

static HEK layout #236

Open rurban opened 9 years ago

rurban commented 9 years ago
  1. Fix the HEK layout finally for once and forever, similar to the recent struct padname_with_str hack.
  2. or fix it case by case by adding free/unshare_hek workarounds or fix the refcounts

hv.h has since 5.8.4 at least HVhek_FREEKEY which is enough. We most likely won't need a new HVhek_STATIC flag. See https://github.com/perl11/cperl/issues/73

This error below was a refcount problem, which is now fixed:

pcc -O3 t/CORE/mro/isarev.t
Assertion failed: (he->shared_he_he.hent_hek == hek), function S_unshare_hek_or_pvn, file hv.c, line 2784.
toddr commented 9 years ago

We determined that mro/isarev.t was not something B::C should be concerned with. In the case above, simply adding sub a fixed the problem.

See 8a3f46eddfa87d53df1e95d5d76073239412807b

rurban commented 9 years ago

For now HEK is still dynamic, but I fixed the assertions with 95d488a8dcc0c7a2ccb144e091f9e972cb42b733 and 1fa99b05d9a3be341edf158e5f089e270e71b1fd

static hek's would allow much faster startup, and use less memory.