The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Devel::Mortality - Helper functions for XS developers debugging mortality issues

SYNOPSIS

  #include "Devel_Mortality.h"
  
  ... then somewhere later in XS land ...
  
  if (DM_SvNEXTMORTAL(sv)) {
    /* SV was mortal which it wasn't supposed to be */
  }
  

DESCRIPTION

This module provides a a few handy macros and functions for checking if SVs are mortal or not. It is not intended to use from Perl except from you Makefile.PL (or Build.PL)

Also make sure this module is loaded when you run your XS or there will be failures.

INTERFACE

MACROS

DM_SvNEXTMORTAL(sv)

Checks if the given SV is flagged temporary and exists in the current stackframe of the mortality list.

DM_SvMAYBEMORTAL(sv)

Checks if the given SV is flagged temporary and exists somewhere in the mortality list.

FUNCTIONS

bool DM_scan_for_mortal(SV *sv, bool from_root, bool to_top)

Scan the PL_tmps_stack for the given SV. If from_root is true scan will be performed from 0 otherwise the value of PL_tmps_floor + 1 is used. If to_top is true scan will be performed to the value of PL_tmps_ix + 1 otherwise to PL_tmps_floor

BUILD UTILITIES

inc_dir

Returns the path to the directory where our header is installed. This should be passed to your C compiler.

EXPORT

Nothing exported.

THANKS

With help and suggestions from Nicholas Clark and Rafaël Garcia-Suarez.

SEE ALSO

perlapi, perlxs

BUGS AND LIMITATIONS

Please report any bugs or feature requests to bug-devel-mortality@rt.cpan.org, or through the web interface at http://rt.cpan.org.

AUTHOR

Claes Jakobsson, Versed Solutions <claesjac@cpan.org>

LICENCE AND COPYRIGHT

Copyright (c) 2008, Versed Solutions <info@versed.se>. All rights reserved.

This software is released under the MIT license cited below.

The "MIT" License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 94:

Non-ASCII character seen before =encoding in 'Rafaël'. Assuming CP1252