Merge branch 'master' into boehm-demers-weiser-gc
authorLudovic Courtès <ludo@gnu.org>
Sun, 22 Mar 2009 14:28:35 +0000 (15:28 +0100)
committerLudovic Courtès <ludo@gnu.org>
Sun, 22 Mar 2009 14:28:35 +0000 (15:28 +0100)
Conflicts:
libguile/continuations.c
libguile/gc-freelist.c
libguile/gc-mark.c
libguile/symbols.c
libguile/threads.c
module/ice-9/boot-9.scm

18 files changed:
1  2 
configure.in
libguile/Makefile.am
libguile/continuations.c
libguile/debug.c
libguile/dynwind.c
libguile/eval.c
libguile/goops.c
libguile/init.c
libguile/load.c
libguile/macros.c
libguile/modules.c
libguile/objects.c
libguile/procs.c
libguile/symbols.c
libguile/threads.c
libguile/threads.h
module/ice-9/boot-9.scm
test-suite/Makefile.am

diff --cc configure.in
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc libguile/eval.c
@@@ -3663,14 -3688,36 +3689,24 @@@ scm_closure (SCM code, SCM env
  
  scm_t_bits scm_tc16_promise;
  
- SCM 
- scm_makprom (SCM code)
- {
+ SCM_DEFINE (scm_make_promise, "make-promise", 1, 0, 0, 
+           (SCM thunk),
+           "Create a new promise object.\n\n"
+             "@code{make-promise} is a procedural form of @code{delay}.\n"
+             "These two expressions are equivalent:\n"
+             "@lisp\n"
+           "(delay @var{exp})\n"
+           "(make-promise (lambda () @var{exp}))\n"
+             "@end lisp\n")
+ #define FUNC_NAME s_scm_make_promise
+ {
+   SCM_VALIDATE_THUNK (1, thunk);
    SCM_RETURN_NEWSMOB2 (scm_tc16_promise,
-                      SCM_UNPACK (code),
+                      SCM_UNPACK (thunk),
                       scm_make_recursive_mutex ());
  }
+ #undef FUNC_NAME
  
 -static SCM
 -promise_mark (SCM promise)
 -{
 -  scm_gc_mark (SCM_PROMISE_MUTEX (promise));
 -  return SCM_PROMISE_DATA (promise);
 -}
 -
 -static size_t
 -promise_free (SCM promise)
 -{
 -  return 0;
 -}
  
  static int 
  promise_print (SCM exp, SCM port, scm_print_state *pstate)
Simple merge
diff --cc libguile/init.c
Simple merge
diff --cc libguile/load.c
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -147,13 -119,27 +147,31 @@@ lookup_interned_symbol (const char *nam
        ;
      }
  
 -  return SCM_BOOL_F;
 +  if (SCM_HASHTABLE_N_ITEMS (symbols) < SCM_HASHTABLE_LOWER (symbols))
 +    /* We removed many symbols in this pass so trigger a rehashing.  */
 +    scm_i_rehash (symbols, scm_i_hash_symbol, 0, "lookup_interned_symbol");
 +
 +  return result;
  }
  
+ /* Intern SYMBOL, an uninterned symbol.  */
+ static void
+ intern_symbol (SCM symbol)
+ {
+   SCM slot, cell;
+   unsigned long hash;
+   hash = scm_i_symbol_hash (symbol) % SCM_HASHTABLE_N_BUCKETS (symbols);
+   slot = SCM_HASHTABLE_BUCKET (symbols, hash);
+   cell = scm_cons (symbol, SCM_UNDEFINED);
+   SCM_SET_HASHTABLE_BUCKET (symbols, hash, scm_cons (cell, slot));
+   SCM_HASHTABLE_INCREMENT (symbols);
+   if (SCM_HASHTABLE_N_ITEMS (symbols) > SCM_HASHTABLE_UPPER (symbols))
+     scm_i_rehash (symbols, scm_i_hash_symbol, 0, "intern_symbol");
+ }
  static SCM
  scm_i_c_mem2symbol (const char *name, size_t len)
  {
@@@ -493,12 -528,11 +493,13 @@@ guilify_self_2 (SCM parent
  {
    scm_i_thread *t = SCM_I_CURRENT_THREAD;
  
 +  t->guile_mode = 1;
 +
    SCM_NEWSMOB (t->handle, scm_tc16_thread, t);
 -  scm_gc_register_collectable_memory (t, sizeof (scm_i_thread), "thread");
 +
    t->continuation_root = scm_cons (t->handle, SCM_EOL);
    t->continuation_base = t->base;
+   t->vm = SCM_BOOL_F;
  
    if (scm_is_true (parent))
      t->dynamic_state = scm_make_dynamic_state (parent);
Simple merge
@@@ -1,6 -1,6 +1,6 @@@
  ;;; installed-scm-file
  
- ;;;; Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008
 -;;;; Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2009
++;;;; Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009
  ;;;; Free Software Foundation, Inc.
  ;;;;
  ;;;; This library is free software; you can redistribute it and/or
Simple merge