[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: smob mark functions in 2.0
From: |
Ludovic Courtès |
Subject: |
Re: smob mark functions in 2.0 |
Date: |
Thu, 24 Nov 2011 00:12:05 +0100 |
User-agent: |
Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.90 (gnu/linux) |
Hello!
Andy Wingo <address@hidden> skribis:
> Specifically, there is a warning in gc/gc_mark.h:
>
> /* WARNING: Such a mark procedure may be invoked on an unused object */
> /* residing on a free list. Such objects are cleared, except for a */
> /* free list link field in the first word. Thus mark procedures may */
> /* not count on the presence of a type descriptor, and must handle this */
> /* case correctly somehow. */
Arrgh!
> So, your mark function might see freed objects. This is terrible, but
> it is the way that it is. The key is that, if you touch a Scheme object
> in your mark function, to first do a check on that object, to see that
> it is valid. You can check the TC bits of the first word, or otherwise
> check that other words are non-NULL.
What about making that check in libguile before invoking the user’s mark
function?
Thanks,
Ludo’.