Received: by 10.68.235.4 with SMTP id ui4mr2937649pbc.3.1330946102587; Mon, 05 Mar 2012 03:15:02 -0800 (PST) Newsgroups: perl.inline Path: h9ni41780pbe.0!nntp.google.com!news2.google.com!volia.net!news2.volia.net!feed-A.news.volia.net!news.musoftware.de!wum.musoftware.de!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!nntp.develooper.com!nntp.perl.org Return-Path: Mailing-List: contact inline-h...@perl.org; run by ezmlm Delivered-To: mailing list inl...@perl.org Received: (qmail 26576 invoked from network); 5 Mar 2012 11:01:45 -0000 Received: from x1.develooper.com (207.171.7.70) by x6.develooper.com with SMTP; 5 Mar 2012 11:01:45 -0000 Received: (qmail 10545 invoked by uid 225); 5 Mar 2012 11:01:45 -0000 Delivered-To: inl...@perl.org Received: (qmail 10541 invoked by alias); 5 Mar 2012 11:01:45 -0000 X-Spam-Status: No, hits=0.8 required=8.0 tests=BAYES_50,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,T_RP_MATCHES_RCVD X-Spam-Check-By: la.mx.develooper.com Received: from smtpout1.voila.fr (HELO smtpout.voila.fr) (193.252.22.125) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Mon, 05 Mar 2012 03:01:41 -0800 Received: from wwinf7122 ([10.232.48.46]) by mwinf5d17 with ME id hn1c1i00G0znlr603n1cKh; Mon, 05 Mar 2012 12:01:36 +0100 Date: Mon, 5 Mar 2012 12:01:36 +0100 (CET) Reply-To: laurent.ha...@voila.fr To: inl...@perl.org Message-ID: <1024709283.1960691330945296443.JavaMail.www@wwinf7122> Subject: calling perl from C MIME-Version: 1.0 X-Originating-IP: [89.2.1.75] X-Wum-Nature: EMAIL-NATURE X-WUM-FROM: |~| X-WUM-TO: |~| X-WUM-REPLYTO: |~| Approved: n...@nntp.perl.org From: laurent.ha...@voila.fr Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello, First, thanks for the Inline::C package, which is well build, and very usef= ull for me. I would like that "C code"=C2=A0=C2=A0 call=C2=A0=C2=A0 "perl sub"=C2=A0=C2= =A0=C2=A0 but=C2=A0=C2=A0=C2=A0 many times. When I execute the script I have a "panic: memory wrap"... Is there a solution to do that... Thanks. Laurent =C2=A0use Inline C; # use Inline 'NoClean', 'FORCE', 'INFO' ; # use Inline Config =3D> WARNINGS =3D> 4;=20 use strict; # c_func_1('This is the first line'); c_func_2('This is the second line'); =C2=A0=C2=A0=C2=A0=20 =C2=A0=C2=A0=C2=A0 sub perl_sub_1 { =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 print map "$_\n", @_; =C2=A0=C2=A0=C2=A0 } =C2=A0=C2=A0=C2=A0=20 __DATA__ __C__ =C2=A0=C2=A0=C2=A0=20 void c_func_1(SV* text) { =C2=A0c_func_2(text); } =C2=A0=C2=A0=C2=A0=20 void c_func_2(SV* text) { int i =3D 0; for (i=3D0;i<10;i++) { =C2=A0perl_call_pv("main::perl_sub_1", 0); =C2=A0//SPAGAIN; } } void cont (void) { } ___________________________________________________________ Les 10 aliments pour lutter contre le rhume ou la grippe sont sur Voila.fr =