NAME

ExtUtils::ExCxx - Switch to ANSI C++ exceptions

SYNOPSIS

require ExtUtils::ExCxx;

DESCRIPTION

Switch perl's default TRYBLOCK method to a C++ try/throw style method at run-time. This should be completely transparent (except to extensions that covertly invoke various low-level exception handling routines :-).

IS C++ FASTER?

Maybe! The C++ version doesn't save/restore the sigprocmask & priocntl state.

$ perl -Mblib ./bench.pl

[ setjmp ] 20 secs (18.79 usr  2.02 sys = 20.81 cpu)
[ cxx    ] 17 secs (17.14 usr  0.00 sys = 17.14 cpu)

PATCHES

At the moment, this extension requires patches to the perl source code. Hopefully, these changes will make it into the next developer release. Either apply stage* or the whole.patch to 5.004_56.

'make test' should be 100%!

(FYI: You don't need to built this extension to test the patch.)

ALSO

call_list has been optimized to call TRYBLOCK only once instead of doing it for each BEGIN or END block. However:

static void try_calllist_normal0(void *locals, void *ret) { AV *list = TRY_CALLLIST_LOCAL(list);

    while (AvFILL(list) >= 0) {
	CV *cv = (CV*)av_shift(list);
	SAVEFREESV(cv);
	PUSHMARK(stack_sp);
	perl_call_sv((SV*)cv, G_EVAL|G_DISCARD);  # hm, still G_EVAL...?
    }
}

Sigsetjmp_t stuff was moved out of JMPENV and all JMPENV manipulation now goes through macros.

FUNCTIONS AFFECTED

  • JMPENV_PUSH

    perl_call_sv
    perl_eval_sv
    docatch
    perl_parse
    perl_run
    call_list
  • JMPENV_JUMP

    die
    croak
    docatch
    pp_goto
    calllist
    my_exit_jump

BUGS

sigsetjmp saves more state than a C++ try block. sigprocmask & priocntl stuff should be addressed.

AUTHOR

Copyright © 1997-1998 Joshua Nathaniel Pritikin. All rights reserved.

This package is free software and is provided "as is" without express or implied warranty. It may be used, redistributed and/or modified under the terms of the Perl Artistic License (see http://www.perl.com/perl/misc/Artistic.html)

The author hereby releases the included patches to the perl source code to the public domain. Thanks a ton! pritikin@mindspring.com

1 POD Error

The following errors were encountered while parsing the POD:

Around line 88:

Non-ASCII character seen before =encoding in '©'. Assuming CP1252