Re: CPython and a C extension using Boehm GC

2007-12-26 Thread MrJean1
FWIIW, I built GC 6.7 on a RHEL 3 (Opteron) system using ./configure --prefix=... --enable-redirect-malloc --enable- threads=posix --enable-thread-local-alloc make; make check; make install Then, I tried running a few examples with 3 different, existing Python binaries each pre-loaded with th

Re: CPython and a C extension using Boehm GC

2007-12-26 Thread MrJean1
It depends on how the GC inside the extension is built. If it is a drop-in replacement for malloc, then GC *must* be loaded and initialized upfront if possible. There is no need to memcpy anything between Python and the extension. However, if GC does not replace malloc, etc., then GC-ed memory i

Re: CPython and a C extension using Boehm GC

2007-12-25 Thread Andrew MacIntyre
malkarouri wrote: > Is it possible to write a Python extension that uses the Boehm garbage > collector? > I have a C library written that makes use of boehm-gc for memory > management. To use that, I have to call GC_INIT() at the start of the > program that uses the library. Now I want to encapsul

Re: CPython and a C extension using Boehm GC

2007-12-25 Thread MrJean1
Correction. The second line should be ... It is probably worth trying. /Jean Brouwers On Dec 25, 12:19 pm, MrJean1 <[EMAIL PROTECTED]> wrote: > Perhaps, you can pre-load the extension library when Python is > invoked. It is probably trying. > > Pre-loading is commonly done done for memory manage

Re: CPython and a C extension using Boehm GC

2007-12-25 Thread MrJean1
Perhaps, you can pre-load the extension library when Python is invoked. It is probably trying. Pre-loading is commonly done done for memory management and profiling libraries and it may (or may not) work for libraries including the Boehm-GC. And if it does work, call GC_INIT inside the initializa

CPython and a C extension using Boehm GC

2007-12-25 Thread malkarouri
Hi everyone, Is it possible to write a Python extension that uses the Boehm garbage collector? I have a C library written that makes use of boehm-gc for memory management. To use that, I have to call GC_INIT() at the start of the program that uses the library. Now I want to encapsulate the library