in reply to Re^3: XS: SvPVLV examples?
in thread XS: SvPVLV examples?

I know.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
RIP PCW It is as I've been saying!(Audio until 20090817)

Replies are listed 'Best First'.
Re^5: XS: SvPVLV examples?
by ikegami (Patriarch) on Sep 25, 2009 at 02:31 UTC
    Then maybe you're missing that there are no non-core magic types?

      Just because there aren't, or at least, so far I haven't located any, doesn't mean there couldn't be. Otherwise there would be no point it the '~' magic type. See item 44 in the third table below Perlguts#magic virtual tables:

      ~ PERL_MAGIC_ext (none) Available for use by ext +ensions

      For my particular purpose, substr magic would work perfectly so long as I can adjust the offset/length appropriately.


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

        Interesting! My last post was wrong. You can add ext magic using sv_magic (no vtable) or sv_magicext (with vtable).

        Then I guess you missed "The extra fields only have meaning to the associated magic handlers". That means it's entirely up to you what you put in them if you have your own magic.

        I wonder if each variables with ext magic has its own virtual table pointer.