in reply to XS and preserving magic

Disclaimer: I do not think that attaching multiple instances of the same type of magic to an SV is good.

sv_magicext() does not have as many restrictions as sv_magic() does. (In fact, sv_magic() is implemented in terms of sv_magicext()) You may need to refer to sv.c to determine what arguments sv_magicext() expects for '~' magic.

Replies are listed 'Best First'.
Re: Re: XS and preserving magic
by shotgunefx (Parson) on Jan 17, 2003 at 23:24 UTC
    Disclaimer: I do not think that attaching multiple instances of the same type of magic to an SV is good.

    May I ask why? Any specific examples? I'm sure there are things I'm missing but, from my perspective, it wasn't worth doing if you couldn't have multiple attachments. Otherwise there is always that long shot of a collision which in my opinion, the vtable would be the last place I ever, ever, ever would look for a problem with a program. (Especially if I was using someone else's module and was not the author)

    The only method it sets is one to decrement the attached reference.

    -Lee

    "To be civilized is to deny one's nature."