Return-Path: Delivered-To: apmail-perl-dev-archive@www.apache.org Received: (qmail 6538 invoked from network); 18 Dec 2004 03:35:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 18 Dec 2004 03:35:30 -0000 Received: (qmail 61525 invoked by uid 500); 18 Dec 2004 03:35:28 -0000 Delivered-To: apmail-perl-dev-archive@perl.apache.org Received: (qmail 61504 invoked by uid 500); 18 Dec 2004 03:35:28 -0000 Mailing-List: contact dev-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Delivered-To: mailing list dev@perl.apache.org Received: (qmail 61489 invoked by uid 99); 18 Dec 2004 03:35:28 -0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of gcamd-dev@m.gmane.org designates 80.91.229.2 as permitted sender) Received: from main.gmane.org (HELO main.gmane.org) (80.91.229.2) by apache.org (qpsmtpd/0.28) with ESMTP; Fri, 17 Dec 2004 19:35:25 -0800 Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1CfVNK-0006LA-00 for ; Sat, 18 Dec 2004 04:35:22 +0100 Received: from adsl-3-10-33.mia.bellsouth.net ([65.3.10.33]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 18 Dec 2004 04:35:22 +0100 Received: from joe+gmane by adsl-3-10-33.mia.bellsouth.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 18 Dec 2004 04:35:22 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: dev@perl.apache.org To: dev@perl.apache.org From: Joe Schaefer Subject: Re: [mp2] pools that go out of scope aren't a problem anymore? Date: Fri, 17 Dec 2004 22:35:15 -0500 Lines: 44 Message-ID: <878y7wl1n0.fsf@gemini.sunstarsys.com> References: <41A60A95.6010904@stason.org> <87fz2x4qu0.fsf@gemini.sunstarsys.com> <41A6411A.3010308@stason.org> <878y8p4p2n.fsf@gemini.sunstarsys.com> <41A66AEA.6090101@stason.org> <41A7A73C.8020701@stason.org> <41A7C343.4010703@stason.org> <41A8C0FE.7020905@stason.org> <41C392C3.60802@stason.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: adsl-3-10-33.mia.bellsouth.net Mail-Copies-To: never User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:SAbr6oSW2f46AzwrlLpud4Lcr5I= Sender: news X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Stas Bekman writes: >> +static MP_INLINE SV *mpxs_APR__Table_make(pTHX_ SV *p_sv, int nelts) >> +{ >> + apr_pool_t *p = mp_xs_sv2_APR__Pool(p_sv); >> + apr_table_t *t = apr_table_make(p, nelts); >> + SV *t_sv = modperl_hash_tie(aTHX_ "APR::Table", Nullsv, t); >> + sv_magic(SvRV(t_sv), p_sv, PERL_MAGIC_ext, Nullch, -1); >> + return t_sv; >> +} > > And that just happened to work, since it wasn't 5.8.x+ > > sv_magic(SvRV(t_sv), p_sv, PERL_MAGIC_ext, Nullch, -1); > > can't be used since it's already used by: > > MP_INLINE SV *modperl_hash_tie(pTHX_ > [...] > > /* Prefetch magic requires perl 5.8 */ > #if ((PERL_REVISION == 5) && (PERL_VERSION >= 8)) > > sv_magic(hv, NULL, PERL_MAGIC_ext, Nullch, -1); > SvMAGIC(hv)->mg_virtual = (MGVTBL *)&modperl_table_magic_prefetch; > SvMAGIC(hv)->mg_flags |= MGf_COPY; > > #endif /* End of prefetch magic */ > > sv_magic(hv, rsv, PERL_MAGIC_tied, Nullch, 0); > > so it happened to worked before I guess because I was testing with 5.6.x, > > with 5.8.x, if I dump the table object it has only one _ext magic. > > so we need to use some other magic to create this dependency. You probably just need to use sv_magicext with 5.8.x, because sv_magic doesn't seem to permit duplicates. The only issue then is ordering: you want the mpxs_APR__Table_make one further down the SvMAGIC chain than the modperl_hash_tie one. -- Joe Schaefer --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org For additional commands, e-mail: dev-help@perl.apache.org