develooper Front page | perl.xs | Postings from October 2011

Re: Throwing exceptions from XS code

Thread Previous
From:
Steffen Mueller
Date:
October 27, 2011 03:51
Subject:
Re: Throwing exceptions from XS code
Message ID:
eea8c693450b7eb418ba2c7f9067ed8b.squirrel@ma2geo.mathematik.uni-karlsruhe.de
> On Wed, Oct 26, 2011 at 22:02, Steffen Mueller <smueller@cpan.org> wrote:
> It works, at least no crashes so far :)
>
> Another question: since I'm returning now the sv exception_object, do
> you know if I have to call sv_2mortal() on it?

You're not returning it, but assigning it to $@, which I believe is
refcounted normally. So I guess you do not have to mortalize.

You can, of course, just try it and see if it crashes. If in doubt,
valgrind will tell you in either case.

Cheers,
Steffen


Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About