Re[2]: [Gc] Determining if pointer GC allocated

Ivan Maidanski ivmai at mail.ru
Thu Dec 29 06:49:31 PST 2011


Hi Hans A.,

I've implemented GC_is_heap_ptr (C, not C++) - see commit dcf6f52 (master branch).
Does it work for you?

Regards

29 12 2011, 01:35 Hans Aberg <haberg-1 at telia.com>:
> On 27 Dec 2011, at 15:29, Ivan Maidanski wrote:
> 
> > Looks reasonable to me. Please provide a patch (I guess GC_is_heap_ptr as a candidate name would be ok.)
> 
> The semantics should just be, in C++ code,
>   inline bool GC_is_heap_ptr(void* xp) { return GC_base(xp) != nullptr; }
> 
> Perhaps a developer of the GC package do a suitable version. (Only C99 has inline functions and bool, and nullptr is C++11.)
> 
> Hans
> 



More information about the Gc mailing list