Stas Bekman <[EMAIL PROTECTED]> writes:
Joe Schaefer wrote:
Stas Bekman <[EMAIL PROTECTED]> writes:
One more thought on this subject. We should probably create the dependency only on custom pools, since doing so on things like $r->pool is just a waste of CPU and memory, since the underlying C object is not controlled by mp2 in this case.
+1. Btw, Stas, IIRC 5.6.x's sv_magic allows multiple ext magic, so theoretically, #ifdef'ing your original 5.6.1 solution with 5.8.x's sv_magicext should work ok.
Really? That's great. so what needs to be figured out is how to
resolve the other problems I've posted about in this thread. Mainly
it's about the usage of the currently existing magic. (All kind of
segfaults happen now)
Ordering them (I'd guess) so mg_find() never confuses the pool's placeholder magic with whatever real ext-magic it's
expecting. But I suspect you've mucked around enough with
this and didn't see anything improve. Sorry I can't offer
more yet. Once I'm caught up, I'll definitely help out here.
As most of the time internal mp magic doesn't use the mg_obj slot, I'm
trying to just to hang the pool object there. that will solve the problem of double magic (I still can't figure how using perl public API one finds more than one magic of the same type) and will save some memory too.
#define mpxs_add_pool_magic(obj, pool_obj) \
if (mpxs_pool_is_custom(SvRV(pool_obj))) { \
MAGIC *mg = mg_find(SvRV(obj), PERL_MAGIC_ext); \
if (mg) { \
if (mg->mg_obj == Nullsv) { \
mg->mg_obj = SvREFCNT_inc(pool_obj); \
mg->mg_flags |= MGf_REFCOUNTED; \
} \
else { \
Perl_croak(aTHX_ "Fixme: don't know how to " \
"handle non-Nullsv magic"); \
} \
} \
else { \
mpxs_add_pool_magic_doit(obj, pool_obj); \
} \
}-- __________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
