On Aug 29, 11:26 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> On Aug 28, 6:23 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
> > On Aug 28, 6:07 pm, mhammond <[EMAIL PROTECTED]> wrote:
>
> > > The XPCOM objects exposed
> > > by Python can be made a GCObject - but I'm not sure how we would
> > > integrate the rest of the Python universe - eg, assuming we have an
> > > arbitrary number of Python objects holding pointers to xpcom objects,
>
> > MMgc is conservative. So long as Python allocates memory to be scanned
> > for pointers to MMgc allocations using MMgc's malloc wrapper, MMgc
> > will find these pointers.
>
> I should have written "using an appropriate malloc wrapper". Ideally
> only memory that might contain pointers to XPGC (heh) objects would be
> allocated with the kContainsPointer MMgc flag.
>
> that may be hard to hook into C-Python. Is it?

I believe it is very hard to hook it into a built Python.  It would be
much easier to hook it in at build time but IIUC, it would also
require that *all* Python extensions you wish to use are also rebuilt;
any prebuilt Python extensions you can find on the web would be
unusable.  My gut tells me that this would be unacceptable to people
using this platform with Python, but hopefully there are some lurkers
here who can throw their 2c in.

Another alternative I'm yet to investigate is that we hack on Python
to offer the ability to hook a memory allocator in at runtime before
Python is initialized.  The downside of this approach is the in the
short-term, we will not be able to work with a released version - it
would need Python 2.6 or later.

But even then, I have a concern regarding other languages - do we
really want to raise the bar for entry into the xpcom world to being
able to integrate with a garbage collection system?  It seems our long
terms goal is to get rid of xpcom in favour of the "one VM for all
languages" approach, so while xpcom remains alive it should keep doing
all it can to be inclusive of the languages able to be supported.

Mark

_______________________________________________
dev-tech-xpcom mailing list
dev-tech-xpcom@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-xpcom

Reply via email to