in reply to Re: Using vec() from XS
in thread Using vec() from XS

I'm not sure how that helps? vec doesn't do any inserts, just update in-place or grow if the offest calculates beyond the current end of string.

It isn't too hard to re-code the math and bit-twiddling, the main problem is getting the memory management right. As vec does everything I need (and more), it would have been nice to find a way to re-use that code without having to either c&p or callback to perl in order to do it.


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.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

Replies are listed 'Best First'.
Re^3: Using vec() from XS
by ysth (Canon) on Sep 23, 2008 at 16:17 UTC
      ...and the lvalue part just builds an SV with some magic attached and returns it.

      When a set operation is performed on the returned SV, the "set" operation from the magic vtable performs the real set on the original SV (the vector) indirectly

      That can also be easily replicated in XS code.