[Gc] Determining if pointer GC allocated

Hans Aberg haberg-1 at telia.com
Sat Dec 31 04:44:52 PST 2011

On 31 Dec 2011, at 13:24, Ivan Maidanski wrote:

> I meant some C legacy code is not legal in C++.
> Eg.:
> ok:
> gcc -I include -c extra/gc.c
> cannot compile:
> gcc -I include -c -x c++ extra/gc.c

Right, with extern "C" {...} the dots are C++ code that will linked according to C conventions. So for this to work, the include might need to be more restrictive. I'm not sure how much worth it would be the effort, though it would be nice to know.

I'm going to experiment with GC_is_heap_ptr() as it is for now. It works as expected, but in my code, leads to some tricky problems when mixing statically and dynamic object.


More information about the Gc mailing list