perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: [mp2] pools that go out of scope aren't a problem anymore?
Date Sat, 18 Dec 2004 02:15:31 GMT
> +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.

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Mime
View raw message