[Gc] GC: New assertions suggested

Boehm, Hans hans.boehm at hp.com
Mon Oct 27 17:01:15 PST 2008


Partially committed.  Let's not put in != NULL assertions before dereferences.  On nearly all platforms, it's easy enough to detect and debug the null pointer case in any case.

Hans

> -----Original Message-----
> From: gc-bounces at napali.hpl.hp.com
> [mailto:gc-bounces at napali.hpl.hp.com] On Behalf Of Ivan Maidanski
> Sent: Tuesday, October 14, 2008 9:15 AM
> To: gc at napali.hpl.hp.com
> Subject: [Gc] GC: New assertions suggested
>
> Hi!
>
> The attached patch does the following suggested improvements:
> - adds runtime assertions for non-null "hhdr" in
> GC_realloc(), GC_size() and GC_is_marked() (this helps
> against invalid arg passing during debugging);
> - fixes assertion in GC_free() (assertion for non-null "hhdr"
> is placed before its dereferencing);
> - treats null "link" arg in
> GC_general_register_disappearing_link() the same way as for
> mis-aligned "link" value (i.e., causing abort with an
> appropriate message);
> - and, besides, changes the declarator for
> GC_register_finalizer_inner() and GC_..._finalize_mark_proc()
> from GC_API to STATIC (since these funcs are not exported and
> are used only locally in "finalize" module).
>
> Bye.
>
>



More information about the Gc mailing list