[Top][All Lists]

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

Re: [PATCH] Marking weak alist vectors

From: Han-Wen Nienhuys
Subject: Re: [PATCH] Marking weak alist vectors
Date: Wed, 09 Nov 2005 11:28:22 +0100
User-agent: Mozilla Thunderbird 1.0.7-1.1.fc4 (X11/20050929)

Ludovic Courtès wrote:
The patch fixes `scm_i_mark_weak_vector_non_weaks ()'.  This way, a
value attached to a weak key will only become unmarked during the mark
phase _after_ the mark phase during which its weak key became unmarked.
You might want to re-read this sentence carefully.  ;-)

Does your patch solve the problem that cyclical structures (values that point back to keys) should also be GC-ed?

/* Attach TO_BE_ATTACHED to OBJ.  */
static SCM
attach_object (SCM obj, SCM to_be_attached)
  my_object_t *c_obj, *c_to_be_attached;

  assert (SCM_SMOB_PREDICATE (my_object_type, obj));
  assert (SCM_SMOB_PREDICATE (my_object_type, to_be_attached));

  /* TO_BE_ATTACHED is attached as a property of OBJ.  As such, OBJ will get
     GC'd _before_ TO_BE_ATTACHED.  */
  scm_primitive_property_set_x (some_property, obj, to_be_attached);

Why are you storing SCM references as properties? It's more efficient both in time and space to use a SCM member in my_object_t.

 Han-Wen Nienhuys - address@hidden -

reply via email to

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