Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
$init-time-num breaks introspection #4853
$ perl6 -e 'say $init-time-num; say CORE::<$init-time-num>'
It's the retrieval of the value from the symbol table that triggers
This actually applies to any native on any PseudoStash:
$ 6 'my int $a = 42; say MY::<$a>'
Also: $init-time-num is an unintended leak of a variable to allow for lazy population of $*INITTIME. I’ve now removed that leak by not populating $*INITTIME lazily anymore. This adds 2 milliseconds to bare startup.
FWIW, the bug seems to be in the underlying nqp::atkey:
$ 6 'use nqp; my int $a = 42; my $m := nqp::getattr(MY::,Map,q/$!storage/); say nqp::atkey($m,q/$a/)'
$ 6 'use nqp; my Int $a = 42; my $m := nqp::getattr(MY::,Map,q/$!storage/); say nqp::atkey($m,q/$a/)’
In 4bc8f3358029866a0854d266 I actually found a way to keep the lazy init *and* remove the leak.