in reply to Re^3: Managing C library memory in XS
in thread Managing C library memory in XS
Speed is not completely irrelevant for the task at hand. That's antoher reason why I'm reluctant to try copy everything back and forth and like the idea of just blessing a reference to a pointer. Also, the C library actaully does have methods for almost everything, so there's very little API use for actually having wrapper Per blessed-hash objects. to manage stuff.
But let me ask the question another way:What does the Perl interpreter guarantee about dual value objects? Is there any official guarantee of semantics?
I Mean... Scalar::Util even advertises the use of dualvar() to set both an interger and a string value on a scalar. So some guarantees must be provided.
If the guarantee is to alway copy and preserve the entire struct SV and struct xpvmg... and in general support multi-valued vars (PV,IV,NV) ...and.. hmm.. NV being the same size as IV, then there should be nothing wrong with the approach.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Managing C library memory in XS
by locked_user sundialsvc4 (Abbot) on May 05, 2014 at 18:57 UTC | |
by petermogensen (Sexton) on May 05, 2014 at 19:10 UTC |