in reply to Re^2: SvUV vs SvIV for pointers in SVs, typemap
in thread SvUV vs SvIV for pointers in SVs, typemap

If you cast the pointer to some int type,

And if you clean your windscreen with a hammer, you'll not like the results either.


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.
  • Comment on Re^3: SvUV vs SvIV for pointers in SVs, typemap

Replies are listed 'Best First'.
Re^4: SvUV vs SvIV for pointers in SVs, typemap
by ikegami (Patriarch) on Feb 20, 2011 at 23:12 UTC
    I disagree. One just needs to cast it back to a pointer before using it. The typemap does this.
      One just needs to cast it back to a pointer before using it.

      This assumes that "one" is writing the code that is manipulating the pointers that are stored in, and manipulated as, SvIVs.

      Have you tried running Perl on a 32-bit system configured for /3GB?

      See also Re: Memory usage in Perl on Windows systems.


      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.

        The SV is not intended to be modifiable. It's just a container for an opaque value. The only "manipulation" being done is to cast the value back to a pointer.

        Have you tried running Perl on a 32-bit system configured for /3GB?

        No. Are you saying that sv = (SV*)(IV)sv fails then? If so, that's a bug. IV is guaranteed to be large enough to hold a pointer.