guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Marking weak alist vectors


From: Marius Vollmer
Subject: Re: [PATCH] Marking weak alist vectors
Date: Wed, 09 Nov 2005 01:51:38 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

address@hidden (Ludovic Courtès) writes:

> The problem stems from the fact that
> `scm_i_mark_weak_vector_non_weaks ()' would not mark a value
> attached to a weak key if that weak key is unmarked.  Therefore,
> both the weak key and its associated value become unmarked during
> the very same mark phase.  And since the order in which they are
> swept during the subsequent sweep phase is undefined, we have a
> problem.

I still have to read your patch carefully, but just from your
description of the problem, I would say that nothing is actually
wrong.  We don't make any guarantees about the sequence in which
objects are 'freed' that are unreachable.

This should only matter for smobs with their user written FREE
procedures.  The manual says:

     The FREE procedure must deallocate all resources that are directly
     associated with the smob instance OBJ.  It must assume that all
     `SCM' values that it references have already been freed and are
     thus invalid.

     It must also not call any libguile function or macro except
     `scm_gc_free', `SCM_SMOB_FLAGS', `SCM_SMOB_DATA',
     `SCM_SMOB_DATA_2', and `SCM_SMOB_DATA_3'.

No?

>   $ guile
>   guile> (gc-live-object-stats)
>   Segmentation fault (core dumped)
>
> BTW, in `scm_init_properties ()', SCM_PROPERTIES_WHASH was not made
> permanent, which looks like an error.

I'll look at these two issues first.

-- 
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3  331E FAF8 226A D5D4 E405




reply via email to

[Prev in Thread] Current Thread [Next in Thread]