Dan Sugalski <[EMAIL PROTECTED]> wrote:cvsuser 04/08/23 13:24:37
Modified: build_tools build_nativecall.pl Log: Due to an amazing amount of ineffable evil in hash.c, build_nativecall got redone to use a PerlHash and PMCs instead of the lower-level access system it had, since that wasn't working
Well, the Evil wasn't in hash.c, the creation of the hash was bogus. It used a pointer PMC to hold the Hash. So that hash got never marked during DOD. I've now tried s/enum_class_Pointer/enum_class_PerlHash/ and it works as expected.
Ah, I was blinded by all the evil in hash.c to the fact that the problem wasn't actually there. :)
But there is another problem with the original cstring hash. It uses string_to_cstring() and never frees the result. OTOH instead of converting the passed STRING to a cstring we could as well keep your patch, which doesn't need the conversion.
Works. While I'm not sure there was a huge scaling issue with the original code, it was nasty, and potentially could be problematic for large library registration, so we might as well leave it as it is now.
For the final version we should probably use CONST_STRING for the signatures, which should be more efficient (with the macro on its own line to work around compiler issues).
Sounds like a plan. -- Dan
--------------------------------------it's like this------------------- Dan Sugalski even samurai [EMAIL PROTECTED] have teddy bears and even teddy bears get drunk