{"push_id":803286411,"size":2,"distinct_size":2,"ref":"refs/heads/configxsrefactor","head":"fa12483d65a28596aa3d44b8e409ee19ea8a2164","before":"45085e3ecd76b8673a213d4cf86ffae5b2e9d78b","commits":[{"sha":"af49509420018167cb0b6673be3632e734ce2c8a","author":{"email":"4c66bc9342f8964ceaaafcdf08a60a021ff9946e@hotmail.com","name":"bulk88"},"message":"add unions & bitfield to SV for easier dump analysis\n\nCalling Perl_dump_sv from a C debugger on demand on a SV* is not always\npossible, if all threads in the process are frozen, it segv'ed or is a\ndump file (not a process), or PerlIO/interp struct is in a partial state\nand can't print to the console. So create this bitfield and any union\non compilers that support anon unions to make looking at the sv head\nand body easier.  I expect more compiler will enable HAS_ANONFIELDS\non them in the future. This code was written to be particularly\nuseful with MS VS IDE's C debugger.","distinct":true,"url":"https://api.github.com/repos/bulk88/cperl/commits/af49509420018167cb0b6673be3632e734ce2c8a"},{"sha":"fa12483d65a28596aa3d44b8e409ee19ea8a2164","author":{"email":"4c66bc9342f8964ceaaafcdf08a60a021ff9946e@hotmail.com","name":"bulk88"},"message":"WIP Config XS refactor try 2\n\n-Turn C global g_iterpos into a per thread safe per interp iternator.\n If 2 different ithreads start to enumerate %Config, random keys will\n start to disappear in each ithread.\n Use an SVIV instead of MY_CXT for the following reasons.\n  -some bytes less memory than a MY_CXT which internally is a SVPV\n  -MY_CXT is 1 extra SV* associated with XS Config implementation, all\n   tied hashes must have an inner blessed refcnted var, previously the\n   inner blessed var was an unused empty HV. Now that SV head/body will\n   be put to use storing the interator+class name, when previously it\n   stored just class name, but had unused slots in the SV body struct since\n   all blessed things are SVt_PVMG or bigger bodies.\n  -MY_CXT's internal implementation puts a 4 byte int in Config.dll/.so's\n   .data (RW) section containing the offset into each interp's my_cxt\n   array. After excluding Visual C's boilerplate libc bloat that it puts in\n   every .dll to support C++ global ctors/dtors and C's atexit, that MY_CXT\n   offset is the one and only piece of data in .data. If you disabled the\n   Visual C boiler plate code and remove MY_CXT, then the .data section in\n   the DLL file and and the 4 KB runtime mem page disappear from the\n   DLL file when the linker creates the DLL.\n  -very unlikely case someone tie()s a new instance of XS Config under a\n   different glob name, now both instances of %Config and %FooConfig have\n   their own iterators inside the same interp thread.\n-make Config_lookup symbol static, no reason for it to be seen outside\n this .o, possible CC optimizations done then and less indirection on ELF\n-newSVpvn_flags(X, X, SVs_TEMP) is faster than sv_2mortal, certain checks\n like for NULL SV * are skipped in perl this way, so use it\n-decrease liveness of various vars like ax and my_perl by reserving perl\n stack space very early, and writing the SV * at the last moment, for\n example, if the CC inlines strlen in FIRSTKEY, my_perl can be kept in a\n volatile register until the 1st function call (assuming strlen inlined)\n which is Perl_newSVpvn_flags, my_perl is never referenced again after the\n Perl_newSVpvn_flags call\n-FETCH\n  -&PL_sv_no is faster than newSVpv_share(\"\", 0), both are empty string\n  -dont ++ refcount then mortal it, for the SV_CONST SV *, waste of time\n    to put the SV * on mortal stack, and later -- it when mortal stack\n    unwinds\n-SCALAR\n  -dont bother checking the incoming arg count and possibly croaking\n   waste of time and PP subs rarely do that\n-KEYS\n  -method KEYS doesnt exist, rename it to something that doesn't look\n   like part of the tied hash API\n  -remove var i for more efficent loop with less vars, var i optimizes away\n   on regular build\n-FIRSTKEY/NEXTKEY\n  -Previously this loop was O(N^2), now its O(N), NEXTKEY did many strlen\n   starting from the start of the string pool for each key lookup, the\n   further down the key name list it went, the more strlen operations it\n   took to reach the next key.\n  -Change the meaning of the iterator from being an index into an array\n   of keys to a byte offset of the next key to read. The string pool is\n   more linked-list-like than array-like. Synthesizing array semantics on\n   a linked list is inefficient. There was a design choice if the iterator\n   should be an absolute char * into the stringpool, or an offset into the\n   string pool that must be recombined with the start of stringpool pointer.\n   I picked the 2nd choice, since PP code can do naughty stuff like\n   ${tied(%Config)} = 12345; and cause random memory reads and junk keys\n   names to be returned. PP code can already do random memory reads with\n   unpack 'P', but that is explicit, messing with XS Config obj is subtly.\n   Plus there is 1 example out there of messing with tied %Config,\n   cpan\\Test-Harness\\t\\lib\\NoFork.pm . With the new byte offset iterator,\n   messing with it in PP will always return either the last half of\n   valid key or undef. The next key will be a full valid key name, or more\n   undef.\n-Makefile.PL\n  -in perl builds that use Makefile.PL and not compile directly from core\n   Makefile, the special XS version of Config.pm needs to be installed\n   to replace the initial dual use PP-mini and XS-full /lib/Config.pm.\nConfig_xs.PL\nMakefile.PL\n  -delete the artificial line numbers, they made C step debugging very hard\n\nsquash config xs wip 2\n\n-undo KEYS rename\n-put back in artifical line numbers\n-SCALAR's retval is more accurate of PP untied hashes\n-KEYS checks context and is more efficient for G_SCALAR","distinct":true,"url":"https://api.github.com/repos/bulk88/cperl/commits/fa12483d65a28596aa3d44b8e409ee19ea8a2164"}]}