guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] GNU Guile branch, master, updated. release_1-9-2-348-g4c


From: Ludovic Courtès
Subject: [Guile-commits] GNU Guile branch, master, updated. release_1-9-2-348-g4c0fc00
Date: Mon, 14 Sep 2009 22:42:03 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=4c0fc0070257cff52d14b340b94d7d05c0ef7260

The branch, master has been updated
       via  4c0fc0070257cff52d14b340b94d7d05c0ef7260 (commit)
       via  8071c4907f895403c1f3a04915b3b34a32881659 (commit)
       via  c058db8a5dd2a9d8ea547236a7d333dfb495bf4a (commit)
       via  706846f66745d5d20909bc5b7c44b566ab0a8f54 (commit)
      from  d3a6162490f78e36be2c6c1c5f7319b2266ac7e0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 4c0fc0070257cff52d14b340b94d7d05c0ef7260
Author: Ludovic Courtès <address@hidden>
Date:   Tue Sep 15 00:40:44 2009 +0200

    Nitpick in `srfi-14.c'.
    
    * libguile/srfi-14.c (scm_i_ucs_range_to_char_set): Fix warning about
      the position of BASE_CS.

commit 8071c4907f895403c1f3a04915b3b34a32881659
Author: Ludovic Courtès <address@hidden>
Date:   Tue Sep 15 00:40:00 2009 +0200

    Make the precise stack mark procedure more robust.
    
    * libguile/vm.c (vm_stack_mark): Return if VM is NULL.

commit c058db8a5dd2a9d8ea547236a7d333dfb495bf4a
Author: Ludovic Courtès <address@hidden>
Date:   Tue Sep 15 00:39:04 2009 +0200

    Use GC-robust queues/lists in `threads.c'.
    
    * libguile/threads.c (remqueue, dequeue, on_thread_exit): Initialize the
      "next" link of the item returned/removed.

commit 706846f66745d5d20909bc5b7c44b566ab0a8f54
Author: Ludovic Courtès <address@hidden>
Date:   Mon Sep 14 23:37:15 2009 +0200

    Remove explicit thread/condvar/mutex finalization.
    
    * libguile/threads.c (fat_mutex_free): Remove explicit `scm_gc_free ()'
      call.
      (fat_cond_free, thread_free): Remove.
      (scm_threads_prehistory): Adjust accordingly.

-----------------------------------------------------------------------

Summary of changes:
 libguile/srfi-14.c |    4 ++--
 libguile/threads.c |   39 +++++++++++++++++++--------------------
 libguile/vm.c      |    3 ++-
 3 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/libguile/srfi-14.c b/libguile/srfi-14.c
index 76e776c..38ef320 100644
--- a/libguile/srfi-14.c
+++ b/libguile/srfi-14.c
@@ -1,6 +1,6 @@
 /* srfi-14.c --- SRFI-14 procedures for Guile
  *
- * Copyright (C) 2001, 2004, 2006, 2007 Free Software Foundation, Inc.
+ * Copyright (C) 2001, 2004, 2006, 2007, 2009 Free Software Foundation, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public License
@@ -1325,7 +1325,7 @@ scm_i_ucs_range_to_char_set (const char *FUNC_NAME, SCM 
lower, SCM upper,
     cs = make_char_set (FUNC_NAME);
   else
     {
-      SCM_VALIDATE_SMOB (4, base_cs, charset);
+      SCM_VALIDATE_SMOB (3, base_cs, charset);
       if (reuse)
         cs = base_cs;
       else
diff --git a/libguile/threads.c b/libguile/threads.c
index 66e3474..174562f 100644
--- a/libguile/threads.c
+++ b/libguile/threads.c
@@ -84,8 +84,14 @@ to_timespec (SCM t, scm_t_timespec *waittime)
     }
 }
 
+
 /*** Queues */
 
+/* Note: We annotate with "GC-robust" assignments whose purpose is to avoid
+   the risk of false references leading to unbounded retained space as
+   described in "Bounding Space Usage of Conservative Garbage Collectors",
+   H.J. Boehm, 2001.  */
+
 /* Make an empty queue data structure.
  */
 static SCM
@@ -128,6 +134,10 @@ remqueue (SCM q, SCM c)
          if (scm_is_eq (c, SCM_CAR (q)))
            SCM_SETCAR (q, SCM_CDR (c));
          SCM_SETCDR (prev, SCM_CDR (c));
+
+         /* GC-robust */
+         SCM_SETCDR (c, SCM_EOL);
+
          SCM_CRITICAL_SECTION_END;
          return 1;
        }
@@ -157,6 +167,10 @@ dequeue (SCM q)
       if (scm_is_null (SCM_CDR (q)))
        SCM_SETCAR (q, SCM_EOL);
       SCM_CRITICAL_SECTION_END;
+
+      /* GC-robust */
+      SCM_SETCDR (c, SCM_EOL);
+
       return SCM_CAR (c);
     }
 }
@@ -199,15 +213,7 @@ thread_print (SCM exp, SCM port, scm_print_state *pstate 
SCM_UNUSED)
   return 1;
 }
 
-static size_t
-thread_free (SCM obj)
-{
-  scm_i_thread *t = SCM_I_THREAD_DATA (obj);
-  assert (t->exited);
-  scm_gc_free (t, sizeof (*t), "thread");
-  return 0;
-}
-
+
 /*** Blocking on queues. */
 
 /* See also scm_i_queue_async_cell for how such a block is
@@ -485,6 +491,10 @@ on_thread_exit (void *v)
     if (*tp == t)
       {
        *tp = t->next_thread;
+
+       /* GC-robust */
+       t->next_thread = NULL;
+
        break;
       }
   thread_count--;
@@ -1084,7 +1094,6 @@ fat_mutex_free (SCM mx)
 {
   fat_mutex *m = SCM_MUTEX_DATA (mx);
   scm_i_pthread_mutex_destroy (&m->lock);
-  scm_gc_free (m, sizeof (fat_mutex), "mutex");
   return 0;
 }
 
@@ -1490,14 +1499,6 @@ SCM_DEFINE (scm_mutex_locked_p, "mutex-locked?", 1, 0, 0,
 }
 #undef FUNC_NAME
 
-static size_t
-fat_cond_free (SCM mx)
-{
-  fat_cond *c = SCM_CONDVAR_DATA (mx);
-  scm_gc_free (c, sizeof (fat_cond), "condition-variable");
-  return 0;
-}
-
 static int
 fat_cond_print (SCM cv, SCM port, scm_print_state *pstate SCM_UNUSED)
 {
@@ -1889,7 +1890,6 @@ scm_init_threads ()
 {
   scm_tc16_thread = scm_make_smob_type ("thread", sizeof (scm_i_thread));
   scm_set_smob_print (scm_tc16_thread, thread_print);
-  scm_set_smob_free (scm_tc16_thread, thread_free); /* XXX: Could be removed */
 
   scm_tc16_mutex = scm_make_smob_type ("mutex", sizeof (fat_mutex));
   scm_set_smob_print (scm_tc16_mutex, fat_mutex_print);
@@ -1898,7 +1898,6 @@ scm_init_threads ()
   scm_tc16_condvar = scm_make_smob_type ("condition-variable",
                                         sizeof (fat_cond));
   scm_set_smob_print (scm_tc16_condvar, fat_cond_print);
-  scm_set_smob_free (scm_tc16_condvar, fat_cond_free);
 
   scm_i_default_dynamic_state = SCM_BOOL_F;
   guilify_self_2 (SCM_BOOL_F);
diff --git a/libguile/vm.c b/libguile/vm.c
index aee2768..4e4a361 100644
--- a/libguile/vm.c
+++ b/libguile/vm.c
@@ -357,7 +357,8 @@ vm_stack_mark (GC_word *addr, struct GC_ms_entry 
*mark_stack_ptr,
      corresponding VM.  */
   vm = * ((struct scm_vm **) addr);
 
-  if ((SCM *) addr != vm->stack_base - 1
+  if (vm == NULL
+      || (SCM *) addr != vm->stack_base - 1
       || vm->stack_limit - vm->stack_base != vm->stack_size)
     /* ADDR must be a pointer to a free-list element, which we must ignore
        (see warning in <gc/gc_mark.h>).  */


hooks/post-receive
-- 
GNU Guile




reply via email to

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