[Gc] mixing GC & malloc data....

Basile Starynkevitch <[email protected]> Wed, 9 Sep 2015 16:55:59 +0200
Newsgroups gmane.comp.programming.garbage-collection.boehmgc
Message-ID <[email protected]>
Hello all,

Is Boehm's GC (e.g. version 7.2d, packaged on my Debian/Sid) compatible 
with malloc (e.g. on recent Linux/x86-64 distributions)? I guess it 
should (in particular for C++11 containers whose internal data is 
generally allocated with ::operator new which wraps malloc)

In other words, I would suppose that with a code like

     void**ptrarr = malloc(5*sizeof(void*));
     ptrarr[0] = GC_MALLOC(512);

and assuming that ptrarr is a global (or some local variable still on 
the call stack) and that the GC_MALLOC gave 0x12345678 which is only 
reachable thru ptrarr[0], I am expecting it to not being released by 
Boehm's GC.

In other words, I suppose that Boehm's GC is managing mmap-ed segments 
(e.g. those asked by the implementation of my system malloc) even when 
they have been mmap-ed by something else that the Boehm's GC internals.

Then I am not sure why a GC_dlopen is needed, since dlopen is doing some 
mmap.

Regards.

-- 
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mine, sont seulement les miennes} ***