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 - [EMAIL PROTECTED] - http://www.xs4all.nl/~hanwen



_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel

Reply via email to