[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: smob mark functions in 2.0
From: |
Andy Wingo |
Subject: |
Re: smob mark functions in 2.0 |
Date: |
Sat, 27 Sep 2014 17:29:02 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
On Fri 26 Sep 2014 06:50, Mark H Weaver <address@hidden> writes:
> Mark H Weaver <address@hidden> writes:
>
>> Andy Wingo <address@hidden> writes:
>>> 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.
>>> */
>>>
>>> So, your mark function might see freed objects.
>>
>> How can this happen?
This can happen if the object is on a free list. Free lists are just
normal heap-managed data structures -- traced by the GC, counting as
live. See e.g. gc-inline.h in master; a variation of this exact code is
used internally in libgc by the allocation API.
Andy
--
http://wingolog.org/