This module provides an alternative to the standard T_PTROBJ approach to creating C struct based objects in Perl.
The traditional way creates a blessed scalar reference, which contains an integer value that is cast to a pointer of the right type.
This is problematic for two reasons:
- If the pointer value is modified (accidentally or maliciously) then this could easily corrupt memory or cause segfaults.
- Scalar references can't be extended with more data without using inside out objects.
This module provides a C api which uses sv_magicext to create safer and more extensible objects associated with some pointer, that interoperates nicely with Moose amongst other things.
This module lets you decorate an arbitrary SV with any other arbitrary SV using the magic hook API.
This is similar to using a fieldhash to create inside out decorations, but is designed to be used primarily from XS code, and as such it provides a C api. The memory footprint is also slightly smaller since there is no auxillary storage.
This module was refactored out of Continuation::Delimited and lets an XS routine trigger code that will be invoked in the context of its caller.
This allows a little more freedom in the stack manipulations you can do (which is of course very important for continuations).
These modules are all possible due to the awesome ExtUtils::Depends module. If you find yourself cargo culting XS consider refactoring it into a reusable module using ExtUtils::Depends instead.