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-5-104-g8f


From: Andy Wingo
Subject: [Guile-commits] GNU Guile branch, master, updated. release_1-9-5-104-g8f79d4e
Date: Sat, 05 Dec 2009 11:40:25 +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=8f79d4ed542686df8345b7b9e3e1d3e14cf4b955

The branch, master has been updated
       via  8f79d4ed542686df8345b7b9e3e1d3e14cf4b955 (commit)
       via  e7efe8e793fa51ea898aea4477939c598b3e9fac (commit)
       via  838aa0007073dbb9e8c91810299c47054ded52bd (commit)
       via  562cd1b8f87dfb099c9cca5dfa4846367e6c9ca3 (commit)
       via  f39448c5a3804f823e367d97cd5e862b016cb8aa (commit)
       via  1be8532fdb7715451b939571f9a147635df9cd65 (commit)
       via  dd3a26f3da712564a294ad5890de12bcc6cb8849 (commit)
       via  45cf24287277c897733e0513bade64cccb1d7608 (commit)
       via  9ea31741dad29ae123e468a203b72df6d190f6e1 (commit)
       via  c99de5aa275b15af207c0dba9717d6b865684fc4 (commit)
      from  314b87163eac1358923cb84e7f2c87d06aa03756 (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 8f79d4ed542686df8345b7b9e3e1d3e14cf4b955
Author: Andy Wingo <address@hidden>
Date:   Sat Dec 5 12:06:16 2009 +0100

    more annotations to scm_i_init_guile
    
    * libguile/init.c (scm_i_init_guile): Annotate things that need smobs.

commit e7efe8e793fa51ea898aea4477939c598b3e9fac
Author: Andy Wingo <address@hidden>
Date:   Sat Dec 5 12:38:32 2009 +0100

    decruftify scm_sys_protects
    
    * libguile/root.h
    * libguile/root.c (scm_sys_protects): It used to be that for some reason
      we'd define a special array of "protected" values. This was a little
      silly, always, but with the BDW GC it's completely unnecessary. Also
      many of these variables were unused, and none of them were good API.
      So remove this array, and either eliminate, make static, or make
      internal the various values.
    
    * libguile/snarf.h: No need to generate calls to scm_permanent_object.
    
    * guile-readline/readline.c (scm_init_readline): No need to call
      scm_permanent_object.
    
    * libguile/array-map.c (ramap, rafe): Remove the dubious nullvect
      optimizations.
    
    * libguile/async.c (scm_init_async): No need to init scm_asyncs, it is
      no more.
    
    * libguile/eval.c (scm_init_eval): No need to init scm_listofnull, it is
      no more.
    
    * libguile/gc.c: Make scm_protects a static var.
      (scm_storage_prehistory): Change the sanity check to use the address
      of protects.
      (scm_init_gc_protect_object): No need to clear the scm_sys_protects,
      as it is no more.
    
    * libguile/keywords.c: Make the keyword obarray a static var.
    * libguile/numbers.c: Make flo0 a static var.
    * libguile/objprop.c: Make object_whash a static var.
    * libguile/properties.c: Make properties_whash a static var.
    
    * libguile/srcprop.h:
    * libguile/srcprop.c: Make scm_source_whash a global with internal
      linkage.
    
    * libguile/strings.h:
    * libguile/strings.c: Make scm_nullstr a global with internal linkage.
    
    * libguile/vectors.c (scm_init_vectors): No need to init scm_nullvect,
      it's unused.

commit 838aa0007073dbb9e8c91810299c47054ded52bd
Author: Andy Wingo <address@hidden>
Date:   Sat Dec 5 11:50:21 2009 +0100

    further boot cleanups
    
    * libguile/srfi-14.c (define_charset):
    * libguile/deprecated.c (scm_create_hook): Don't bother making the
      returned objects (hooks or charsets) into permanent objects; they are
      already defined, and then the caller probably stores them away too.
    
    * libguile/init.c (scm_i_init_guile): Add a couple annotations.

commit 562cd1b8f87dfb099c9cca5dfa4846367e6c9ca3
Author: Andy Wingo <address@hidden>
Date:   Sat Dec 5 11:43:20 2009 +0100

    more boot cleanup
    
    * libguile/bytevectors.c (scm_bootstrap_bytevectors): Remove a call to
      scm_gc_protect_object.
    
    * libguile/gc.h:
    * libguile/gc.c (scm_init_gc_protect_object): Rename from
      scm_init_storage, and just return void. Make the GC boot procs have
      internal linkage.
    
    * libguile/init.c: Adapt to the name change.

commit f39448c5a3804f823e367d97cd5e862b016cb8aa
Author: Andy Wingo <address@hidden>
Date:   Sat Dec 5 11:30:09 2009 +0100

    remove a bunch of needless scm_permanent_object calls
    
    * libguile/array-handle.c:
    * libguile/bytevectors.c:
    * libguile/deprecated.c:
    * libguile/eval.c:
    * libguile/feature.c:
    * libguile/filesys.c:
    * libguile/gc.c:
    * libguile/gdbint.c:
    * libguile/goops.c:
    * libguile/instructions.c:
    * libguile/load.c:
    * libguile/modules.c:
    * libguile/numbers.c:
    * libguile/options.c:
    * libguile/ports.c:
    * libguile/scmsigs.c:
    * libguile/srcprop.c:
    * libguile/srfi-4.c:
    * libguile/stacks.c:
    * libguile/threads.c:
    * libguile/vm.c: Remove calls to scm_permanent_object, as they are no
      longer needed with the BDW GC.

commit 1be8532fdb7715451b939571f9a147635df9cd65
Author: Andy Wingo <address@hidden>
Date:   Sat Dec 5 11:16:54 2009 +0100

    some scm_i_init_guile cleanups
    
    * libguile/init.c (scm_i_init_guile): Since hash tables are tc7 objects,
      things that depend on hash tables no longer depend on smobs, so move
      smob_prehistory up a bit. No more struct_prehistory.
    
    * libguile/struct.h:
    * libguile/struct.c (scm_struct_prehistory): Remove empty function.

commit dd3a26f3da712564a294ad5890de12bcc6cb8849
Author: Andy Wingo <address@hidden>
Date:   Sat Dec 5 11:10:11 2009 +0100

    remove scm_ports_prehistory
    
    * libguile/ports.h:
    * libguile/ports.c (scm_ports_prehistory): Remove this function. Just
      initialize global vars to NULL/0 instead of needing a prehistory
      function.

commit 45cf24287277c897733e0513bade64cccb1d7608
Author: Andy Wingo <address@hidden>
Date:   Sat Dec 5 10:55:37 2009 +0100

    add printer for dynamic-states
    
    * libguile/fluids.c:
    * libguile/fluids.h:
    * libguile/print.c: Add dynamic-state printing infrastructure.

commit 9ea31741dad29ae123e468a203b72df6d190f6e1
Author: Andy Wingo <address@hidden>
Date:   Sat Dec 5 10:52:18 2009 +0100

    fluids are tc7 objects
    
    If you're wondering what I'm doing, I'm trying to eventually reimplement
    smobs in terms of structs, so that applicable smobs can just follow the
    applicable struct dispatch path. But to do that I have to get structs
    initialized before things that use smobs, which means transforming a
    bunch of smobby things to tc7 things. But this transformation is good
    for performance anyway, and we currently have a glut of unused tc7s,
    so here we go...
    
    * libguile/tags.h (scm_tc7_fluid, scm_tc7_dynamic_state): Fluids (and
      dynamic states) now have tc7s.
    
    * libguile/fluids.h: Remove scm_fluids_prehistory, and add internal
      scm_i_fluid_print. Update a comment.
    
    * libguile/fluids.c: Update for tc7 representation. Also remove the next
      pointers while we're at it, as they aren't used in the new BDW GC.
    
    * libguile/eq.c (scm_equal_p): Remove the hashtable case. Hashtables
      could never be equal? before, I don't see why to add stubs doing the
      same thing now.
    
    * libguile/print.c (iprin1):
    * libguile/gc.c (scm_i_tag_name):
    * libguile/evalext.c (scm_self_evaluating_p): Add fluid and
      dynamic_state cases.
    
    * libguile/goops.h: Remove scm_class_hashtable; it will be static.
    * libguile/goops.c: Make <hashtable> static, and add <fluid> and
      <dynamic-state> classes.
    
    * libguile/hashtab.h:
    * libguile/hashtab.c: Remove scm_i_hashtable_equal_p.
    
    * libguile/init.c (scm_i_init_guile): Remove call to fluids_prehistory.

commit c99de5aa275b15af207c0dba9717d6b865684fc4
Author: Andy Wingo <address@hidden>
Date:   Sat Dec 5 10:07:07 2009 +0100

    hash tables have a tc7
    
    * libguile/tags.h (scm_tc7_hashtable): Allocate a tc7 for hashtables.
    
    * libguile/hashtab.h: Adjust macros accordingly.
      (scm_i_hashtable_print, scm_i_hashtable_equal_p): New internal
      functions.
      (scm_hashtab_prehistory): Remove, no more need for this.
    
    * libguile/hashtab.c (scm_hash_fn_remove_x): Fix a longstanding bug.
      (make_hash_table): Adapt to the new hash table representation.
    
    * libguile/eq.c (scm_equal_p)
    * libguile/evalext.c (scm_self_evaluating_p)
    * libguile/print.c (iprin1)
    * libguile/gc.c (scm_i_tag_name): Add some tc7_hashtab cases.
    
    * libguile/init.c: Remove unused environments init functions. Remove
      call to hashtab_prehistory.
    
    * libguile/goops.h (scm_class_hashtable)
    * libguile/goops.c (scm_class_of, create_standard_classes): Have to
      make a class for hash tables manually, because they aren't smobs any
      more.

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

Summary of changes:
 guile-readline/readline.c |    2 +-
 libguile/array-handle.c   |    3 +-
 libguile/array-map.c      |   13 +-----
 libguile/async.c          |    1 -
 libguile/bytevectors.c    |    7 +--
 libguile/deprecated.c     |   12 ++---
 libguile/eq.c             |    1 +
 libguile/eval.c           |    3 -
 libguile/evalext.c        |    3 +
 libguile/feature.c        |    4 +-
 libguile/filesys.c        |    2 +-
 libguile/fluids.c         |   67 ++++++++++---------------------
 libguile/fluids.h         |   28 +++++++-------
 libguile/gc.c             |   33 ++++++++--------
 libguile/gc.h             |    6 +-
 libguile/gdbint.c         |    2 +-
 libguile/goops.c          |   93 ++++++++++++++++++---------------------------
 libguile/goops.h          |    3 +-
 libguile/hashtab.c        |   30 ++++----------
 libguile/hashtab.h        |   12 ++---
 libguile/init.c           |   94 ++++++++++++++++++---------------------------
 libguile/instructions.c   |    3 +-
 libguile/keywords.c       |   10 +++--
 libguile/load.c           |    2 +-
 libguile/modules.c        |   21 ++++------
 libguile/numbers.c        |   21 +++++-----
 libguile/objprop.c        |   12 +++--
 libguile/options.c        |    3 +-
 libguile/ports.c          |   21 +++-------
 libguile/ports.h          |    1 -
 libguile/print.c          |    9 ++++
 libguile/properties.c     |   14 ++++---
 libguile/root.c           |    6 +--
 libguile/root.h           |   16 --------
 libguile/scmsigs.c        |    6 +--
 libguile/snarf.h          |   16 ++++----
 libguile/srcprop.c        |    6 +-
 libguile/srcprop.h        |    1 +
 libguile/srfi-14.c        |    2 +-
 libguile/srfi-4.c         |   12 ++----
 libguile/stacks.c         |    6 +--
 libguile/strings.c        |    2 +
 libguile/strings.h        |    2 +
 libguile/struct.c         |    6 ---
 libguile/struct.h         |    1 -
 libguile/tags.h           |   10 +---
 libguile/threads.c        |    5 +-
 libguile/vectors.c        |    2 -
 libguile/vm.c             |    8 ++--
 49 files changed, 262 insertions(+), 381 deletions(-)

diff --git a/guile-readline/readline.c b/guile-readline/readline.c
index 5f6719d..2d3617d 100644
--- a/guile-readline/readline.c
+++ b/guile-readline/readline.c
@@ -557,7 +557,7 @@ scm_init_readline ()
   rl_basic_word_break_characters = "\t\n\"'`;()";
   rl_readline_name = "Guile";
 
-  reentry_barrier_mutex = scm_permanent_object (scm_make_mutex ());
+  reentry_barrier_mutex = scm_make_mutex ();
   scm_init_opts (scm_readline_options,
                 scm_readline_opts);
 #if HAVE_RL_GET_KEYMAP
diff --git a/libguile/array-handle.c b/libguile/array-handle.c
index cd5a466..ec3127a 100644
--- a/libguile/array-handle.c
+++ b/libguile/array-handle.c
@@ -132,8 +132,7 @@ void
 scm_init_array_handle (void)
 {
 #define DEFINE_ARRAY_TYPE(tag, TAG)                             \
-  scm_i_array_element_types[SCM_ARRAY_ELEMENT_TYPE_##TAG]   \
-    = (scm_permanent_object (scm_from_locale_symbol (#tag)))
+  scm_i_array_element_types[SCM_ARRAY_ELEMENT_TYPE_##TAG] = 
scm_from_locale_symbol (#tag)
   
   scm_i_array_element_types[SCM_ARRAY_ELEMENT_TYPE_SCM] = SCM_BOOL_T;
   DEFINE_ARRAY_TYPE (a, CHAR);
diff --git a/libguile/array-map.c b/libguile/array-map.c
index 747747a..c673b4d 100644
--- a/libguile/array-map.c
+++ b/libguile/array-map.c
@@ -645,11 +645,7 @@ ramap (SCM ra0, SCM proc, SCM ras)
       unsigned long k, i1 = SCM_I_ARRAY_BASE (ra1);
       long inc1 = SCM_I_ARRAY_DIMS (ra1)->inc;
       ra1 = SCM_I_ARRAY_V (ra1);
-      ras = SCM_CDR (ras);
-      if (scm_is_null(ras))
-       ras = scm_nullvect;
-      else
-       ras = scm_vector (ras);
+      ras = scm_vector (SCM_CDR (ras));
       
       for (; i <= n; i++, i1 += inc1)
        {
@@ -706,11 +702,8 @@ rafe (SCM ra0, SCM proc, SCM ras)
       unsigned long k, i1 = SCM_I_ARRAY_BASE (ra1);
       long inc1 = SCM_I_ARRAY_DIMS (ra1)->inc;
       ra1 = SCM_I_ARRAY_V (ra1);
-      ras = SCM_CDR (ras);
-      if (scm_is_null(ras))
-       ras = scm_nullvect;
-      else
-       ras = scm_vector (ras);
+      ras = scm_vector (SCM_CDR (ras));
+
       for (; i <= n; i++, i0 += inc0, i1 += inc1)
        {
          args = SCM_EOL;
diff --git a/libguile/async.c b/libguile/async.c
index 664264f..7ec8b6e 100644
--- a/libguile/async.c
+++ b/libguile/async.c
@@ -501,7 +501,6 @@ scm_async_tick (void)
 void
 scm_init_async ()
 {
-  scm_asyncs = SCM_EOL;
   tc16_async = scm_make_smob_type ("async", 0);
 
 #include "libguile/async.x"
diff --git a/libguile/bytevectors.c b/libguile/bytevectors.c
index 992fa3f..ac5bc16 100644
--- a/libguile/bytevectors.c
+++ b/libguile/bytevectors.c
@@ -2202,13 +2202,12 @@ scm_bootstrap_bytevectors (void)
   /* This must be instantiated here because the generalized-vector API may
      want to access bytevectors even though `(rnrs bytevector)' hasn't been
      loaded.  */
-  scm_null_bytevector =
-    scm_gc_protect_object (make_bytevector (0, SCM_ARRAY_ELEMENT_TYPE_VU8));
+  scm_null_bytevector = make_bytevector (0, SCM_ARRAY_ELEMENT_TYPE_VU8);
 
 #ifdef WORDS_BIGENDIAN
-  scm_i_native_endianness = scm_permanent_object (scm_from_locale_symbol 
("big"));
+  scm_i_native_endianness = scm_from_locale_symbol ("big");
 #else
-  scm_i_native_endianness = scm_permanent_object (scm_from_locale_symbol 
("little"));
+  scm_i_native_endianness = scm_from_locale_symbol ("little");
 #endif
 
   scm_c_register_extension ("libguile", "scm_init_bytevectors",
diff --git a/libguile/deprecated.c b/libguile/deprecated.c
index 9364a69..ac10c7a 100644
--- a/libguile/deprecated.c
+++ b/libguile/deprecated.c
@@ -249,15 +249,13 @@ static SCM try_module_autoload_var;
 static void
 init_module_stuff ()
 {
-#define PERM(x) scm_permanent_object(x)
-
   if (module_prefix == SCM_BOOL_F)
     {
-      module_prefix = PERM (scm_list_2 (scm_sym_app, scm_sym_modules));
-      make_modules_in_var = PERM (scm_c_lookup ("make-modules-in"));
+      module_prefix = scm_list_2 (scm_sym_app, scm_sym_modules);
+      make_modules_in_var = scm_c_lookup ("make-modules-in");
       beautify_user_module_x_var =
-       PERM (scm_c_lookup ("beautify-user-module!"));
-      try_module_autoload_var = PERM (scm_c_lookup ("try-module-autoload"));
+       scm_c_lookup ("beautify-user-module!");
+      try_module_autoload_var = scm_c_lookup ("try-module-autoload");
     }
 }
 
@@ -425,7 +423,7 @@ scm_create_hook (const char *name, int n_args)
   {
     SCM hook = scm_make_hook (scm_from_int (n_args));
     scm_c_define (name, hook);
-    return scm_permanent_object (hook);
+    return hook;
   }
 }
 
diff --git a/libguile/eq.c b/libguile/eq.c
index 422f1a5..eaf1acc 100644
--- a/libguile/eq.c
+++ b/libguile/eq.c
@@ -30,6 +30,7 @@
 #include "libguile/smob.h"
 #include "libguile/arrays.h"
 #include "libguile/vectors.h"
+#include "libguile/hashtab.h"
 #include "libguile/bytevectors.h"
 
 #include "libguile/struct.h"
diff --git a/libguile/eval.c b/libguile/eval.c
index 4525e4f..ec19c23 100644
--- a/libguile/eval.c
+++ b/libguile/eval.c
@@ -923,10 +923,7 @@ scm_init_eval ()
   scm_init_opts (scm_eval_options_interface,
                 scm_eval_opts);
   
-  scm_listofnull = scm_list_1 (SCM_EOL);
-
   f_apply = scm_c_define_gsubr ("apply", 2, 0, 1, scm_apply);
-  scm_permanent_object (f_apply);
 
   scm_tc16_boot_closure = scm_make_smob_type ("boot-closure", 0);
   scm_set_smob_apply (scm_tc16_boot_closure, boot_closure_apply, 0, 0, 1);
diff --git a/libguile/evalext.c b/libguile/evalext.c
index 27dd985..9af8383 100644
--- a/libguile/evalext.c
+++ b/libguile/evalext.c
@@ -77,6 +77,9 @@ SCM_DEFINE (scm_self_evaluating_p, "self-evaluating?", 1, 0, 
0,
        {
        case scm_tc7_vector:
        case scm_tc7_wvect:
+       case scm_tc7_hashtable:
+       case scm_tc7_fluid:
+       case scm_tc7_dynamic_state:
        case scm_tc7_number:
        case scm_tc7_string:
        case scm_tc7_smob:
diff --git a/libguile/feature.c b/libguile/feature.c
index 9ef4b65..7007403 100644
--- a/libguile/feature.c
+++ b/libguile/feature.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995,1996,1998,1999,2000,2001,2002, 2003, 2004, 2006, 2007 
Free Software Foundation, Inc.
+/* Copyright (C) 1995,1996,1998,1999,2000,2001,2002, 2003, 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
@@ -99,7 +99,7 @@ SCM_DEFINE (scm_set_program_arguments_scm, 
"set-program-arguments", 1, 0, 0,
 void
 scm_init_feature()
 {
-  progargs_fluid = scm_permanent_object (scm_make_fluid ());
+  progargs_fluid = scm_make_fluid ();
 
   features_var = scm_c_define ("*features*", SCM_EOL);
 #ifndef _Windows
diff --git a/libguile/filesys.c b/libguile/filesys.c
index 311f1ef..e60efdd 100644
--- a/libguile/filesys.c
+++ b/libguile/filesys.c
@@ -1712,7 +1712,7 @@ scm_init_filesys ()
   scm_set_smob_free (scm_tc16_dir, scm_dir_free);
   scm_set_smob_print (scm_tc16_dir, scm_dir_print);
 
-  scm_dot_string = scm_permanent_object (scm_from_locale_string ("."));
+  scm_dot_string = scm_from_locale_string (".");
   
 #ifdef O_RDONLY
   scm_c_define ("O_RDONLY", scm_from_int (O_RDONLY));
diff --git a/libguile/fluids.c b/libguile/fluids.c
index 75dcccf..427d406 100644
--- a/libguile/fluids.c
+++ b/libguile/fluids.c
@@ -26,7 +26,6 @@
 
 #include "libguile/_scm.h"
 #include "libguile/print.h"
-#include "libguile/smob.h"
 #include "libguile/dynwind.h"
 #include "libguile/fluids.h"
 #include "libguile/alist.h"
@@ -66,22 +65,12 @@ static size_t allocated_fluids_len = 0;
 static size_t allocated_fluids_num = 0;
 static char *allocated_fluids = NULL;
 
-static scm_t_bits tc16_fluid;
+#define IS_FLUID(x)         (!SCM_IMP (x) && SCM_TYP7 (x) == scm_tc7_fluid)
+#define FLUID_NUM(x)        ((size_t)SCM_CELL_WORD_1(x))
 
-#define IS_FLUID(x)         SCM_SMOB_PREDICATE(tc16_fluid, (x))
-#define FLUID_NUM(x)        ((size_t)SCM_SMOB_DATA(x))
-#define FLUID_NEXT(x)       SCM_SMOB_OBJECT_2(x)
-#define FLUID_NEXT_LOC(x)       SCM_SMOB_OBJECT_2_LOC(x)
-#define SET_FLUID_NEXT(x,y) SCM_SET_SMOB_OBJECT_2((x), (y))
-
-static scm_t_bits tc16_dynamic_state;
-
-#define IS_DYNAMIC_STATE(x)        SCM_SMOB_PREDICATE(tc16_dynamic_state, (x))
-#define DYNAMIC_STATE_FLUIDS(x)        SCM_SMOB_OBJECT(x)
-#define SET_DYNAMIC_STATE_FLUIDS(x, y) SCM_SET_SMOB_OBJECT((x), (y))
-#define DYNAMIC_STATE_NEXT(x)          SCM_SMOB_OBJECT_2(x)
-#define DYNAMIC_STATE_NEXT_LOC(x)          SCM_SMOB_OBJECT_2_LOC(x)
-#define SET_DYNAMIC_STATE_NEXT(x, y)   SCM_SET_SMOB_OBJECT_2((x), (y))
+#define IS_DYNAMIC_STATE(x) (!SCM_IMP (x) && SCM_TYP7 (x) == 
scm_tc7_dynamic_state)
+#define DYNAMIC_STATE_FLUIDS(x)        SCM_PACK (SCM_CELL_WORD_1 (x))
+#define SET_DYNAMIC_STATE_FLUIDS(x, y) SCM_SET_CELL_WORD_1 ((x), (SCM_UNPACK 
(y)))
 
 
 
@@ -115,13 +104,20 @@ grow_dynamic_state (SCM state)
   scm_i_pthread_mutex_unlock (&fluid_admin_mutex);
 }
 
-static int
-fluid_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)
+void
+scm_i_fluid_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)
 {
   scm_puts ("#<fluid ", port);
   scm_intprint ((int) FLUID_NUM (exp), 10, port);
   scm_putc ('>', port);
-  return 1;
+}
+
+void
+scm_i_dynamic_state_print (SCM exp, SCM port, scm_print_state *pstate 
SCM_UNUSED)
+{
+  scm_puts ("#<dynamic-state ", port);
+  scm_intprint (SCM_UNPACK (exp), 16, port);
+  scm_putc ('>', port);
 }
 
 static size_t
@@ -190,12 +186,7 @@ SCM_DEFINE (scm_make_fluid, "make-fluid", 0, 0, 0,
            "with its own dynamic state, you can use fluids for thread local 
storage.")
 #define FUNC_NAME s_scm_make_fluid
 {
-  SCM fluid;
-
-  SCM_NEWSMOB2 (fluid, tc16_fluid,
-               (scm_t_bits) next_fluid_num (), SCM_UNPACK (SCM_EOL));
-
-  return fluid;
+  return scm_cell (scm_tc7_fluid, (scm_t_bits) next_fluid_num ());
 }
 #undef FUNC_NAME
 
@@ -406,10 +397,7 @@ SCM
 scm_i_make_initial_dynamic_state ()
 {
   SCM fluids = scm_c_make_vector (allocated_fluids_len, SCM_BOOL_F);
-  SCM state;
-  SCM_NEWSMOB2 (state, tc16_dynamic_state,
-               SCM_UNPACK (fluids), SCM_UNPACK (SCM_EOL));
-  return state;
+  return scm_cell (scm_tc7_dynamic_state, SCM_UNPACK (fluids));
 }
 
 SCM_DEFINE (scm_make_dynamic_state, "make-dynamic-state", 0, 1, 0,
@@ -418,17 +406,14 @@ SCM_DEFINE (scm_make_dynamic_state, "make-dynamic-state", 
0, 1, 0,
            "or of the current dynamic state when @var{parent} is omitted.")
 #define FUNC_NAME s_scm_make_dynamic_state
 {
-  SCM fluids, state;
+  SCM fluids;
 
   if (SCM_UNBNDP (parent))
     parent = scm_current_dynamic_state ();
 
-  scm_assert_smob_type (tc16_dynamic_state, parent);
+  SCM_ASSERT (IS_DYNAMIC_STATE (parent), parent, SCM_ARG1, FUNC_NAME);
   fluids = scm_vector_copy (DYNAMIC_STATE_FLUIDS (parent));
-  SCM_NEWSMOB2 (state, tc16_dynamic_state,
-               SCM_UNPACK (fluids), SCM_UNPACK (SCM_EOL));
-
-  return state;
+  return scm_cell (scm_tc7_dynamic_state, SCM_UNPACK (fluids));
 }
 #undef FUNC_NAME
 
@@ -465,7 +450,7 @@ SCM_DEFINE (scm_set_current_dynamic_state, 
"set-current-dynamic-state", 1,0,0,
 {
   scm_i_thread *t = SCM_I_CURRENT_THREAD;
   SCM old = t->dynamic_state;
-  scm_assert_smob_type (tc16_dynamic_state, state);
+  SCM_ASSERT (IS_DYNAMIC_STATE (state), state, SCM_ARG1, FUNC_NAME);
   t->dynamic_state = state;
   return old;
 }
@@ -481,7 +466,7 @@ void
 scm_dynwind_current_dynamic_state (SCM state)
 {
   SCM loc = scm_cons (state, SCM_EOL);
-  scm_assert_smob_type (tc16_dynamic_state, state);
+  SCM_ASSERT (IS_DYNAMIC_STATE (state), state, SCM_ARG1, NULL);
   scm_dynwind_rewind_handler_with_scm (swap_dynamic_state, loc,
                                     SCM_F_WIND_EXPLICITLY);
   scm_dynwind_unwind_handler_with_scm (swap_dynamic_state, loc,
@@ -514,14 +499,6 @@ SCM_DEFINE (scm_with_dynamic_state, "with-dynamic-state", 
2, 0, 0,
 }
 #undef FUNC_NAME
 
-void
-scm_fluids_prehistory ()
-{
-  tc16_fluid = scm_make_smob_type ("fluid", 0);
-  scm_set_smob_print (tc16_fluid, fluid_print);
-
-  tc16_dynamic_state = scm_make_smob_type ("dynamic-state", 0);
-}
 
 void
 scm_init_fluids ()
diff --git a/libguile/fluids.h b/libguile/fluids.h
index 2bfcce5..3a651fb 100644
--- a/libguile/fluids.h
+++ b/libguile/fluids.h
@@ -3,7 +3,7 @@
 #ifndef SCM_FLUIDS_H
 #define SCM_FLUIDS_H
 
-/* Copyright (C) 1996,2000,2001, 2006, 2008 Free Software Foundation, Inc.
+/* Copyright (C) 1996,2000,2001, 2006, 2008, 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
@@ -29,18 +29,17 @@
 
 /* Fluids.
 
-   Fluids are objects of a certain type (a smob) that can hold one SCM
-   value per dynamic state.  That is, modifications to this value are
-   only visible to code that executes with the same dynamic state as
-   the modifying code.  When a new dynamic state is constructed, it
-   inherits the values from its parent.  Because each thread executes
-   with its own dynamic state, you can use fluids for thread local
-   storage.
-
-   Each fluid is identified by a small integer.  This integer is used
-   to index a vector that holds the values of all fluids.  A dynamic
-   state consists of this vector, wrapped in a smob so that the vector
-   can grow.
+   Fluids are objects of a certain type that can hold one SCM value per
+   dynamic state. That is, modifications to this value are only visible
+   to code that executes with the same dynamic state as the modifying
+   code. When a new dynamic state is constructed, it inherits the
+   values from its parent. Because each thread executes with its own
+   dynamic state, you can use fluids for thread local storage.
+
+   Each fluid is identified by a small integer. This integer is used to
+   index a vector that holds the values of all fluids. A dynamic state
+   consists of this vector, wrapped in an object so that the vector can
+   grow.
  */
 
 /* The fastest way to acces/modify the value of a fluid.  These macros
@@ -78,7 +77,8 @@ SCM_API SCM scm_with_dynamic_state (SCM state, SCM proc);
 
 SCM_INTERNAL SCM scm_i_make_initial_dynamic_state (void);
 
-SCM_INTERNAL void scm_fluids_prehistory (void);
+SCM_INTERNAL void scm_i_fluid_print (SCM exp, SCM port, scm_print_state 
*pstate);
+SCM_INTERNAL void scm_i_dynamic_state_print (SCM exp, SCM port, 
scm_print_state *pstate);
 SCM_INTERNAL void scm_init_fluids (void);
 
 #endif  /* SCM_FLUIDS_H */
diff --git a/libguile/gc.c b/libguile/gc.c
index 6a70250..4bd1d5d 100644
--- a/libguile/gc.c
+++ b/libguile/gc.c
@@ -90,6 +90,9 @@ int scm_debug_cells_gc_interval = 0;
  */
 int scm_i_cell_validation_already_running ;
 
+static SCM protects;
+
+
 #if (SCM_DEBUG_CELL_ACCESSES == 1)
 
 
@@ -505,7 +508,7 @@ scm_gc_protect_object (SCM obj)
      critsec/mutex inconsistency here. */
   SCM_CRITICAL_SECTION_START;
 
-  handle = scm_hashq_create_handle_x (scm_protects, obj, scm_from_int (0));
+  handle = scm_hashq_create_handle_x (protects, obj, scm_from_int (0));
   SCM_SETCDR (handle, scm_sum (SCM_CDR (handle), scm_from_int (1)));
 
   protected_obj_count ++;
@@ -535,7 +538,7 @@ scm_gc_unprotect_object (SCM obj)
       abort ();
     }
  
-  handle = scm_hashq_get_handle (scm_protects, obj);
+  handle = scm_hashq_get_handle (protects, obj);
 
   if (scm_is_false (handle))
     {
@@ -546,7 +549,7 @@ scm_gc_unprotect_object (SCM obj)
     {
       SCM count = scm_difference (SCM_CDR (handle), scm_from_int (1));
       if (scm_is_eq (count, scm_from_int (0)))
-       scm_hashq_remove_x (scm_protects, obj);
+       scm_hashq_remove_x (protects, obj);
       else
        SCM_SETCDR (handle, count);
     }
@@ -634,7 +637,7 @@ scm_storage_prehistory ()
   /* GC_REGISTER_DISPLACEMENT (scm_tc3_unused); */
 
   /* Sanity check.  */
-  if (!GC_is_visible (scm_sys_protects))
+  if (!GC_is_visible (&protects))
     abort ();
 
   scm_c_hook_init (&scm_before_gc_c_hook, 0, SCM_C_HOOK_NORMAL);
@@ -646,14 +649,10 @@ scm_storage_prehistory ()
 
 scm_i_pthread_mutex_t scm_i_gc_admin_mutex = SCM_I_PTHREAD_MUTEX_INITIALIZER;
 
-int
-scm_init_storage ()
+void
+scm_init_gc_protect_object ()
 {
-  size_t j;
-
-  j = SCM_NUM_PROTECTS;
-  while (j)
-    scm_sys_protects[--j] = SCM_BOOL_F;
+  protects = scm_c_make_hash_table (31);
 
 #if 0
   /* We can't have a cleanup handler since we have no thread to run it
@@ -668,10 +667,6 @@ scm_init_storage ()
 #endif
 
 #endif
-
-  scm_protects = scm_c_make_hash_table (31);
-
-  return 0;
 }
 
 
@@ -756,6 +751,12 @@ scm_i_tag_name (scm_t_bits tag)
       return "cons (non-immediate car)";
     case scm_tc7_pws:
       return "pws";
+    case scm_tc7_hashtable:
+      return "hashtable";
+    case scm_tc7_fluid:
+      return "fluid";
+    case scm_tc7_dynamic_state:
+      return "dynamic state";
     case scm_tc7_wvect:
       return "weak vector";
     case scm_tc7_vector:
@@ -811,7 +812,7 @@ scm_init_gc ()
 {
   /* `GC_INIT ()' was invoked in `scm_storage_prehistory ()'.  */
 
-  scm_after_gc_hook = scm_permanent_object (scm_make_hook (SCM_INUM0));
+  scm_after_gc_hook = scm_make_hook (SCM_INUM0);
   scm_c_define ("after-gc-hook", scm_after_gc_hook);
 
   gc_async = scm_c_make_gsubr ("%gc-thunk", 0, 0, 0, gc_async_thunk);
diff --git a/libguile/gc.h b/libguile/gc.h
index 34c9b84..05b08af 100644
--- a/libguile/gc.h
+++ b/libguile/gc.h
@@ -237,9 +237,9 @@ SCM_API void scm_gc_register_root (SCM *p);
 SCM_API void scm_gc_unregister_root (SCM *p);
 SCM_API void scm_gc_register_roots (SCM *b, unsigned long n);
 SCM_API void scm_gc_unregister_roots (SCM *b, unsigned long n);
-SCM_API void scm_storage_prehistory (void);
-SCM_API int scm_init_storage (void);
-SCM_API void scm_init_gc (void);
+SCM_INTERNAL void scm_storage_prehistory (void);
+SCM_INTERNAL void scm_init_gc_protect_object (void);
+SCM_INTERNAL void scm_init_gc (void);
 
 #if SCM_ENABLE_DEPRECATED == 1
 
diff --git a/libguile/gdbint.c b/libguile/gdbint.c
index 351b7ba..7cc9535 100644
--- a/libguile/gdbint.c
+++ b/libguile/gdbint.c
@@ -166,7 +166,7 @@ gdb_read (char *str)
        }
     }
   gdb_result = ans;
-  /* Protect answer from future GC */
+  /* Protect answer from future GC (FIXME: still needed with BDW-GC?) */
   if (SCM_NIMP (ans))
     scm_permanent_object (ans);
 exit:
diff --git a/libguile/goops.c b/libguile/goops.c
index f6b18ac..f3a28d9 100644
--- a/libguile/goops.c
+++ b/libguile/goops.c
@@ -158,6 +158,10 @@ SCM scm_class_protected_hidden, 
scm_class_protected_opaque, scm_class_protected_
 SCM scm_class_scm;
 SCM scm_class_int, scm_class_float, scm_class_double;
 
+static SCM class_hashtable;
+static SCM class_fluid;
+static SCM class_dynamic_state;
+
 /* Port classes.  Allocate 3 times the maximum number of port types so that
    input ports, output ports, and in/out ports can be stored at different
    offsets.  See `SCM_IN_PCLASS_INDEX' et al.  */
@@ -210,6 +214,12 @@ SCM_DEFINE (scm_class_of, "class-of", 1, 0, 0,
        case scm_tc7_vector:
        case scm_tc7_wvect:
          return scm_class_vector;
+       case scm_tc7_hashtable:
+         return class_hashtable;
+       case scm_tc7_fluid:
+         return class_fluid;
+       case scm_tc7_dynamic_state:
+         return class_dynamic_state;
        case scm_tc7_string:
          return scm_class_string;
         case scm_tc7_number:
@@ -869,9 +879,7 @@ create_basic_classes (void)
   /**** <class> ****/
   SCM cs = scm_from_locale_string (SCM_CLASS_CLASS_LAYOUT);
   SCM name = scm_from_locale_symbol ("<class>");
-  scm_class_class = scm_permanent_object (scm_make_vtable_vtable (cs,
-                                                                 SCM_INUM0,
-                                                                 SCM_EOL));
+  scm_class_class = scm_make_vtable_vtable (cs, SCM_INUM0, SCM_EOL);
   SCM_SET_CLASS_FLAGS (scm_class_class, (SCM_CLASSF_GOOPS_OR_VALID
                                         | SCM_CLASSF_METACLASS));
 
@@ -893,19 +901,15 @@ create_basic_classes (void)
 
   /**** <top> ****/
   name = scm_from_locale_symbol ("<top>");
-  scm_class_top = scm_permanent_object (scm_basic_make_class (scm_class_class,
-                                                   name,
-                                                   SCM_EOL,
-                                                   SCM_EOL));
+  scm_class_top = scm_basic_make_class (scm_class_class, name,
+                                        SCM_EOL, SCM_EOL);
 
   DEFVAR(name, scm_class_top);
 
   /**** <object> ****/
   name  = scm_from_locale_symbol ("<object>");
-  scm_class_object = scm_permanent_object (scm_basic_make_class 
(scm_class_class,
-                                                      name,
-                                                      scm_list_1 
(scm_class_top),
-                                                      SCM_EOL));
+  scm_class_object = scm_basic_make_class (scm_class_class, name,
+                                           scm_list_1 (scm_class_top), 
SCM_EOL);
 
   DEFVAR (name, scm_class_object);
 
@@ -1620,10 +1624,6 @@ scm_change_object_class (SCM obj, SCM old_class 
SCM_UNUSED, SCM new_class)
 
 SCM_KEYWORD (k_name, "name");
 
-SCM_SYMBOL (sym_no_method, "no-method");
-
-static SCM list_of_no_method;
-
 SCM_GLOBAL_SYMBOL (scm_sym_args, "args");
 
 
@@ -2258,12 +2258,9 @@ make_stdcls (SCM *var, char *name, SCM meta, SCM super, 
SCM slots)
 {
    SCM tmp = scm_from_locale_symbol (name);
 
-   *var = scm_permanent_object (scm_basic_make_class (meta,
-                                                     tmp,
-                                                     scm_is_pair (super)
-                                                     ? super
-                                                     : scm_list_1 (super),
-                                                     slots));
+   *var = scm_basic_make_class (meta, tmp,
+                                scm_is_pair (super) ? super : scm_list_1 
(super),
+                                slots);
    DEFVAR(tmp, *var);
 }
 
@@ -2400,6 +2397,12 @@ create_standard_classes (void)
               scm_class_class, scm_class_top,             SCM_EOL);
   make_stdcls (&scm_class_vector,         "<vector>",
               scm_class_class, scm_class_top,             SCM_EOL);
+  make_stdcls (&class_hashtable,          "<hashtable>",
+              scm_class_class, scm_class_top,             SCM_EOL);
+  make_stdcls (&class_fluid,              "<fluid>",
+              scm_class_class, scm_class_top,             SCM_EOL);
+  make_stdcls (&class_dynamic_state,      "<dynamic-state>",
+              scm_class_class, scm_class_top,             SCM_EOL);
   make_stdcls (&scm_class_number,         "<number>",
               scm_class_class, scm_class_top,             SCM_EOL);
   make_stdcls (&scm_class_complex,        "<complex>",
@@ -2451,12 +2454,8 @@ make_class_from_template (char const *template, char 
const *type_name, SCM super
   else
     name = SCM_GOOPS_UNBOUND;
 
-  class = scm_permanent_object (scm_basic_make_class (applicablep
-                                                     ? 
scm_class_procedure_class
-                                                     : scm_class_class,
-                                                     name,
-                                                     supers,
-                                                     SCM_EOL));
+  class = scm_basic_make_class (applicablep ? scm_class_procedure_class : 
scm_class_class,
+                                name, supers, SCM_EOL);
 
   /* Only define name if doesn't already exist. */
   if (!SCM_GOOPS_UNBOUNDP (name)
@@ -2479,12 +2478,8 @@ make_class_from_symbol (SCM type_name_sym, SCM supers, 
int applicablep)
   else
     name = SCM_GOOPS_UNBOUND;
 
-  class = scm_permanent_object (scm_basic_make_class (applicablep
-                                                     ? 
scm_class_procedure_class
-                                                     : scm_class_class,
-                                                     name,
-                                                     supers,
-                                                     SCM_EOL));
+  class = scm_basic_make_class (applicablep ? scm_class_procedure_class : 
scm_class_class,
+                                name, supers, SCM_EOL);
 
   /* Only define name if doesn't already exist. */
   if (!SCM_GOOPS_UNBOUNDP (name)
@@ -2694,23 +2689,17 @@ SCM_DEFINE (scm_sys_goops_loaded, "%goops-loaded", 0, 
0, 0,
 {
   goops_loaded_p = 1;
   var_compute_applicable_methods =
-    scm_permanent_object
-    (scm_module_variable (scm_module_goops, sym_compute_applicable_methods));
+    scm_module_variable (scm_module_goops, sym_compute_applicable_methods);
   var_slot_unbound =
-    scm_permanent_object
-    (scm_module_variable (scm_module_goops, sym_slot_unbound));
+    scm_module_variable (scm_module_goops, sym_slot_unbound);
   var_slot_missing =
-    scm_permanent_object
-    (scm_module_variable (scm_module_goops, sym_slot_missing));
+    scm_module_variable (scm_module_goops, sym_slot_missing);
   var_compute_cpl =
-    scm_permanent_object
-    (scm_module_variable (scm_module_goops, sym_compute_cpl));
+    scm_module_variable (scm_module_goops, sym_compute_cpl);
   var_no_applicable_method =
-    scm_permanent_object
-    (scm_module_variable (scm_module_goops, sym_no_applicable_method));
+    scm_module_variable (scm_module_goops, sym_no_applicable_method);
   var_change_class =
-    scm_permanent_object
-    (scm_module_variable (scm_module_goops, sym_change_class));
+    scm_module_variable (scm_module_goops, sym_change_class);
   setup_extended_primitive_generics ();
   return SCM_UNSPECIFIED;
 }
@@ -2723,18 +2712,12 @@ scm_init_goops_builtins (void)
 {
   scm_module_goops = scm_current_module ();
 
-  /* Not really necessary right now, but who knows...
-   */
-  scm_permanent_object (scm_module_goops);
-
   goops_rstate = scm_c_make_rstate ("GOOPS", 5);
 
 #include "libguile/goops.x"
 
-  list_of_no_method = scm_permanent_object (scm_list_1 (sym_no_method));
-
   hell = scm_calloc (hell_size * sizeof (*hell));
-  hell_mutex = scm_permanent_object (scm_make_mutex ());
+  hell_mutex = scm_make_mutex ();
 
   create_basic_classes ();
   create_standard_classes ();
@@ -2744,10 +2727,8 @@ scm_init_goops_builtins (void)
 
   {
     SCM name = scm_from_locale_symbol ("no-applicable-method");
-    scm_no_applicable_method
-      = scm_permanent_object (scm_make (scm_list_3 (scm_class_generic,
-                                                   k_name,
-                                                   name)));
+    scm_no_applicable_method =
+      scm_make (scm_list_3 (scm_class_generic, k_name, name));
     DEFVAR (name, scm_no_applicable_method);
   }
 
diff --git a/libguile/goops.h b/libguile/goops.h
index 914ab3c..48b94a1 100644
--- a/libguile/goops.h
+++ b/libguile/goops.h
@@ -179,7 +179,8 @@ SCM_API SCM scm_class_string;
 SCM_API SCM scm_class_symbol;
 SCM_API SCM scm_class_procedure_with_setter;
 SCM_API SCM scm_class_primitive_generic;
-SCM_API SCM scm_class_vector, scm_class_null;
+SCM_API SCM scm_class_vector;
+SCM_API SCM scm_class_null;
 SCM_API SCM scm_class_real;
 SCM_API SCM scm_class_complex;
 SCM_API SCM scm_class_integer;
diff --git a/libguile/hashtab.c b/libguile/hashtab.c
index f3b3548..059be6f 100644
--- a/libguile/hashtab.c
+++ b/libguile/hashtab.c
@@ -50,10 +50,7 @@
  *
  */
 
-/* Hash tables are either vectors of association lists or smobs
- * containing such vectors.  Currently, the vector version represents
- * constant size tables while those wrapped in a smob represents
- * resizing tables.
+/* A hash table is a cell containing a vector of association lists.
  *
  * Growing or shrinking, with following rehashing, is triggered when
  * the load factor
@@ -69,8 +66,6 @@
  * hashtable_size.
  */
 
-scm_t_bits scm_tc16_hashtable;
-
 static unsigned long hashtable_size[] = {
   31, 61, 113, 223, 443, 883, 1759, 3517, 7027, 14051, 28099, 56197, 112363,
   224717, 449419, 898823, 1797641, 3595271, 7190537, 14381041
@@ -230,7 +225,7 @@ weak_bucket_assoc (SCM table, SCM buckets, size_t 
bucket_index,
 static SCM
 make_hash_table (int flags, unsigned long k, const char *func_name) 
 {
-  SCM table, vector;
+  SCM vector;
   scm_t_hashtable *t;
   int i = 0, n = k ? k : 31;
   while (i < HASHTABLE_SIZE_N && n > hashtable_size[i])
@@ -250,9 +245,9 @@ make_hash_table (int flags, unsigned long k, const char 
*func_name)
   t->flags = flags;
   t->hash_fn = NULL;
 
-  SCM_NEWSMOB2 (table, scm_tc16_hashtable, vector, t);
-
-  return table;
+  /* FIXME: we just need two words of storage, not three */
+  return scm_double_cell (scm_tc7_hashtable, SCM_UNPACK (vector),
+                          (scm_t_bits)t, 0);
 }
 
 void
@@ -342,8 +337,8 @@ scm_i_rehash (SCM table,
 }
 
 
-static int
-hashtable_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)
+void
+scm_i_hashtable_print (SCM exp, SCM port, scm_print_state *pstate)
 {
   scm_puts ("#<", port);
   if (SCM_HASHTABLE_WEAK_KEY_P (exp))
@@ -358,7 +353,6 @@ hashtable_print (SCM exp, SCM port, scm_print_state *pstate 
SCM_UNUSED)
   scm_uintprint (SCM_SIMPLE_VECTOR_LENGTH (SCM_HASHTABLE_VECTOR (exp)),
                 10, port);
   scm_puts (">", port);
-  return 1;
 }
 
 
@@ -650,7 +644,7 @@ scm_hash_fn_remove_x (SCM table, SCM obj,
                  SCM_ARG1, "hash_fn_remove_x");
       buckets = table;
     }
-  if (SCM_SIMPLE_VECTOR_LENGTH (table) == 0)
+  if (SCM_SIMPLE_VECTOR_LENGTH (buckets) == 0)
     return SCM_EOL;
 
   k = hash_fn (obj, SCM_SIMPLE_VECTOR_LENGTH (buckets), closure);
@@ -1259,14 +1253,6 @@ SCM_DEFINE (scm_hash_map_to_list, "hash-map->list", 2, 
0, 0,
 
 
 void
-scm_hashtab_prehistory ()
-{
-  /* Initialize the hashtab SMOB type.  */
-  scm_tc16_hashtable = scm_make_smob_type (s_hashtable, 0);
-  scm_set_smob_print (scm_tc16_hashtable, hashtable_print);
-}
-
-void
 scm_init_hashtab ()
 {
 #include "libguile/hashtab.x"
diff --git a/libguile/hashtab.h b/libguile/hashtab.h
index b60cd43..75b60e9 100644
--- a/libguile/hashtab.h
+++ b/libguile/hashtab.h
@@ -32,14 +32,12 @@
 #define SCM_HASHTABLEF_WEAK_CAR SCM_WVECTF_WEAK_KEY
 #define SCM_HASHTABLEF_WEAK_CDR SCM_WVECTF_WEAK_VALUE
 
-SCM_API scm_t_bits scm_tc16_hashtable;
-
-#define SCM_HASHTABLE_P(x)        SCM_SMOB_PREDICATE (scm_tc16_hashtable, x)
+#define SCM_HASHTABLE_P(x) (!SCM_IMP (x) && SCM_TYP7(x) == scm_tc7_hashtable)
 #define SCM_VALIDATE_HASHTABLE(pos, arg) \
   SCM_MAKE_VALIDATE_MSG (pos, arg, HASHTABLE_P, "hash-table")
-#define SCM_HASHTABLE_VECTOR(h)  SCM_SMOB_OBJECT (h)
-#define SCM_SET_HASHTABLE_VECTOR(x, v) SCM_SET_SMOB_OBJECT ((x), (v))
-#define SCM_HASHTABLE(x)          ((scm_t_hashtable *) SCM_SMOB_DATA_2 (x))
+#define SCM_HASHTABLE_VECTOR(h)  SCM_CELL_OBJECT_1 (h)
+#define SCM_SET_HASHTABLE_VECTOR(x, v) SCM_SET_CELL_OBJECT_1 ((x), (v))
+#define SCM_HASHTABLE(x)          ((scm_t_hashtable *) SCM_CELL_WORD_2 (x))
 #define SCM_HASHTABLE_FLAGS(x)    (SCM_HASHTABLE (x)->flags)
 #define SCM_HASHTABLE_WEAK_KEY_P(x) \
   (SCM_HASHTABLE_FLAGS (x) & SCM_HASHTABLEF_WEAK_CAR)
@@ -158,7 +156,7 @@ SCM_API SCM scm_hash_fold (SCM proc, SCM init, SCM hash);
 SCM_API SCM scm_hash_for_each (SCM proc, SCM hash);
 SCM_API SCM scm_hash_for_each_handle (SCM proc, SCM hash);
 SCM_API SCM scm_hash_map_to_list (SCM proc, SCM hash);
-SCM_INTERNAL void scm_hashtab_prehistory (void);
+SCM_INTERNAL void scm_i_hashtable_print (SCM exp, SCM port, scm_print_state 
*pstate);
 SCM_INTERNAL void scm_init_hashtab (void);
 
 #endif  /* SCM_HASHTAB_H */
diff --git a/libguile/init.c b/libguile/init.c
index 2180e45..9ffc90a 100644
--- a/libguile/init.c
+++ b/libguile/init.c
@@ -49,9 +49,6 @@
 #include "libguile/deprecation.h"
 #include "libguile/dynl.h"
 #include "libguile/dynwind.h"
-#if 0
-#include "libguile/environments.h"
-#endif
 #include "libguile/eq.h"
 #include "libguile/error.h"
 #include "libguile/eval.h"
@@ -438,79 +435,64 @@ scm_i_init_guile (SCM_STACKITEM *base)
     }
 
   scm_storage_prehistory ();
-  scm_threads_prehistory (base);
-  scm_ports_prehistory ();
-  scm_smob_prehistory ();
-  scm_fluids_prehistory ();
-  scm_weaks_prehistory ();
-  scm_hashtab_prehistory ();   /* requires storage_prehistory, and
-                                  weaks_prehistory */
+  scm_threads_prehistory (base);  /* requires storage_prehistory */
+  scm_weaks_prehistory ();        /* requires storage_prehistory */
 #ifdef GUILE_DEBUG_MALLOC
   scm_debug_malloc_prehistory ();
 #endif
-  if (scm_init_storage ())        /* requires threads_prehistory,
-                                    smob_prehistory and
-                                    hashtab_prehistory */
-    abort ();
-  
-  scm_struct_prehistory ();      /* requires storage */
-  scm_symbols_prehistory ();      /* requires storage */
-#if 0
-  scm_environments_prehistory (); /* requires storage */
-#endif
-  scm_modules_prehistory ();      /* requires storage and hash tables */
-  scm_init_variable ();           /* all bindings need variables */
-  scm_init_continuations ();
+  scm_smob_prehistory ();
+  scm_symbols_prehistory ();      /* requires weaks_prehistory */
+  scm_modules_prehistory ();
+  scm_init_variable ();
+  scm_init_continuations ();      /* requires smob_prehistory */
   scm_init_root ();              /* requires continuations */
-  scm_init_threads ();            /* requires fluids */
+  scm_init_threads ();            /* requires smob_prehistory */
   scm_init_gsubr ();
   scm_init_thread_procs ();       /* requires gsubrs */
   scm_init_procprop ();
-#if 0
-  scm_init_environments ();
-#endif
   scm_init_alist ();
-  scm_init_arbiters ();
-  scm_init_async ();
+  scm_init_arbiters ();           /* requires smob_prehistory */
+  scm_init_async ();              /* requires smob_prehistory */
   scm_init_boolean ();
   scm_init_chars ();
 #ifdef GUILE_DEBUG_MALLOC
   scm_init_debug_malloc ();
 #endif
-  scm_init_dynwind ();
+  scm_init_dynwind ();            /* requires smob_prehistory */
   scm_init_eq ();
   scm_init_error ();
   scm_init_fluids ();
-  scm_init_feature ();          /* Requires fluids */
-  scm_init_backtrace ();       /* Requires fluids */
+  scm_init_feature ();
+  scm_init_backtrace ();
   scm_init_fports ();
   scm_init_strports ();
   scm_init_ports ();
-  scm_init_gdbint ();           /* Requires strports */
   scm_init_hash ();
   scm_init_hashtab ();
-  scm_init_deprecation ();      /* Requires hashtabs */
+  scm_init_deprecation ();
   scm_init_objprop ();
-  scm_init_promises ();
+  scm_init_promises ();         /* requires smob_prehistory */
   scm_init_properties ();
   scm_init_hooks ();            /* Requires smob_prehistory */
-  scm_init_gc ();              /* Requires hooks, async */
+  scm_init_gc ();              /* Requires hooks */
+  scm_init_gc_protect_object ();  /* requires threads_prehistory */
+  scm_init_gdbint ();           /* Requires strports, gc_protect_object */
   scm_init_gettext ();
   scm_init_ioext ();
-  scm_init_keywords ();
+  scm_init_keywords ();    /* Requires smob_prehistory */
   scm_init_list ();
-  scm_init_macros ();
-  scm_init_mallocs ();
-  scm_init_modules ();
+  scm_init_macros ();      /* Requires smob_prehistory */
+  scm_init_mallocs ();     /* Requires smob_prehistory */
+  scm_init_modules ();     /* Requires smob_prehistory */
   scm_init_numbers ();
   scm_init_options ();
   scm_init_pairs ();
 #ifdef HAVE_POSIX
-  scm_init_filesys ();
+  scm_init_filesys ();     /* Requires smob_prehistory */
   scm_init_posix ();
 #endif
 #ifdef HAVE_REGCOMP
-  scm_init_regex_posix ();
+  scm_init_regex_posix (); /* Requires smob_prehistory */
 #endif
   scm_init_procs ();
   scm_init_scmsigs ();
@@ -519,7 +501,7 @@ scm_i_init_guile (SCM_STACKITEM *base)
   scm_init_socket ();
 #endif
   scm_init_sort ();
-  scm_init_srcprop ();
+  scm_init_srcprop ();     /* requires smob_prehistory */
   scm_init_stackchk ();
 
   scm_init_array_handle ();
@@ -527,43 +509,43 @@ scm_i_init_guile (SCM_STACKITEM *base)
   scm_init_generalized_vectors ();
   scm_init_vectors ();
   scm_init_uniform ();
-  scm_init_bitvectors ();
+  scm_init_bitvectors ();  /* Requires smob_prehistory */
   scm_bootstrap_bytevectors ();
-  scm_init_srfi_4 ();
-  scm_init_arrays ();
+  scm_init_srfi_4 ();  /* requires smob_prehistory */
+  scm_init_arrays ();  /* Requires smob_prehistory */
   scm_init_array_map ();
 
-  scm_bootstrap_vm ();
+  scm_bootstrap_vm ();  /* requires smob_prehistory, gc_permanent_object */
 
   scm_init_strings ();  /* Requires array-handle */
   scm_init_struct ();   /* Requires strings */
-  scm_init_frames ();
+  scm_init_frames ();   /* Requires smob_prehistory */
   scm_init_stacks ();   /* Requires strings, struct, frames */
   scm_init_symbols ();
   scm_init_values ();   /* Requires struct */
   scm_init_load ();     /* Requires strings */
-  scm_init_print ();   /* Requires strings, struct */
+  scm_init_print ();   /* Requires strings, struct, smob */
   scm_init_read ();
   scm_init_stime ();
   scm_init_strorder ();
   scm_init_srfi_13 ();
-  scm_init_srfi_14 ();
-  scm_init_throw ();
+  scm_init_srfi_14 ();  /* Requires smob_prehistory */
+  scm_init_throw ();    /* Requires smob_prehistory */
   scm_init_trees ();
   scm_init_version ();
   scm_init_weaks ();
-  scm_init_guardians ();
+  scm_init_guardians (); /* requires smob_prehistory */
   scm_init_vports ();
   scm_init_standard_ports ();  /* Requires fports */
-  scm_init_memoize ();
-  scm_init_eval ();
+  scm_init_memoize ();  /* Requires smob_prehistory */
+  scm_init_eval ();     /* Requires smob_prehistory */
   scm_init_load_path ();
   scm_init_eval_in_scheme ();
   scm_init_evalext ();
   scm_init_debug ();   /* Requires macro smobs */
-  scm_init_random ();
+  scm_init_random ();   /* Requires smob_prehistory */
   scm_init_simpos ();
-  scm_init_dynamic_linking ();
+  scm_init_dynamic_linking (); /* Requires smob_prehistory */
   scm_bootstrap_i18n ();
 #if SCM_ENABLE_ELISP
   scm_init_lang ();
diff --git a/libguile/instructions.c b/libguile/instructions.c
index c870b31..c8d95cc 100644
--- a/libguile/instructions.c
+++ b/libguile/instructions.c
@@ -67,8 +67,7 @@ fetch_instruction_table ()
         {
           table[i].opcode = i;
           if (table[i].name)
-            table[i].symname =
-              scm_permanent_object (scm_from_locale_symbol (table[i].name));
+            table[i].symname = scm_from_locale_symbol (table[i].name);
           else
             table[i].symname = SCM_BOOL_F;
         }
diff --git a/libguile/keywords.c b/libguile/keywords.c
index c415ccb..0740801 100644
--- a/libguile/keywords.c
+++ b/libguile/keywords.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001, 2003, 2004, 2006, 2008 
Free Software Foundation, Inc.
+/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001, 2003, 2004, 2006, 2008, 
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
@@ -37,6 +37,8 @@
 
 
 
+static SCM keyword_obarray;
+
 scm_t_bits scm_tc16_keyword;
 
 #define KEYWORDP(X)    (SCM_SMOB_PREDICATE (scm_tc16_keyword, (X)))
@@ -71,11 +73,11 @@ SCM_DEFINE (scm_symbol_to_keyword, "symbol->keyword", 1, 0, 
0,
 
   SCM_CRITICAL_SECTION_START;
   /* njrev: NEWSMOB and hashq_set_x can raise errors */
-  keyword = scm_hashq_ref (scm_keyword_obarray, symbol, SCM_BOOL_F);
+  keyword = scm_hashq_ref (keyword_obarray, symbol, SCM_BOOL_F);
   if (scm_is_false (keyword))
     {
       SCM_NEWSMOB (keyword, scm_tc16_keyword, SCM_UNPACK (symbol));
-      scm_hashq_set_x (scm_keyword_obarray, symbol, keyword);
+      scm_hashq_set_x (keyword_obarray, symbol, keyword);
     }
   SCM_CRITICAL_SECTION_END;
   return keyword;
@@ -117,7 +119,7 @@ scm_init_keywords ()
   scm_tc16_keyword = scm_make_smob_type ("keyword", 0);
   scm_set_smob_print (scm_tc16_keyword, keyword_print);
 
-  scm_keyword_obarray = scm_c_make_hash_table (0);
+  keyword_obarray = scm_c_make_hash_table (0);
 #include "libguile/keywords.x"
 }
 
diff --git a/libguile/load.c b/libguile/load.c
index fd3626f..c150030 100644
--- a/libguile/load.c
+++ b/libguile/load.c
@@ -881,7 +881,7 @@ init_build_info ()
 void
 scm_init_load ()
 {
-  scm_listofnullstr = scm_permanent_object (scm_list_1 (scm_nullstr));
+  scm_listofnullstr = scm_list_1 (scm_nullstr);
   scm_loc_load_path = SCM_VARIABLE_LOC (scm_c_define ("%load-path", SCM_EOL));
   scm_loc_load_extensions
     = SCM_VARIABLE_LOC (scm_c_define ("%load-extensions",
diff --git a/libguile/modules.c b/libguile/modules.c
index c48c2e8..58c5248 100644
--- a/libguile/modules.c
+++ b/libguile/modules.c
@@ -862,8 +862,7 @@ SCM_SYMBOL (scm_sym_system_module, "system-module");
 void
 scm_modules_prehistory ()
 {
-  scm_pre_modules_obarray 
-    = scm_permanent_object (scm_c_make_hash_table (1533));
+  scm_pre_modules_obarray = scm_c_make_hash_table (1533);
 }
 
 void
@@ -875,24 +874,22 @@ scm_init_modules ()
   scm_tc16_eval_closure = scm_make_smob_type ("eval-closure", 0);
   scm_set_smob_apply (scm_tc16_eval_closure, scm_eval_closure_lookup, 2, 0, 0);
 
-  the_module = scm_permanent_object (scm_make_fluid ());
+  the_module = scm_make_fluid ();
 }
 
 static void
 scm_post_boot_init_modules ()
 {
-#define PERM(x) scm_permanent_object(x)
-
   SCM module_type = SCM_VARIABLE_REF (scm_c_lookup ("module-type"));
   scm_module_tag = (SCM_CELL_WORD_1 (module_type) + scm_tc3_struct);
 
-  resolve_module_var = PERM (scm_c_lookup ("resolve-module"));
-  process_define_module_var = PERM (scm_c_lookup ("process-define-module"));
-  process_use_modules_var = PERM (scm_c_lookup ("process-use-modules"));
-  module_export_x_var = PERM (scm_c_lookup ("module-export!"));
-  the_root_module_var = PERM (scm_c_lookup ("the-root-module"));
-  default_duplicate_binding_procedures_var =
-    PERM (scm_c_lookup ("default-duplicate-binding-procedures"));
+  resolve_module_var = scm_c_lookup ("resolve-module");
+  process_define_module_var = scm_c_lookup ("process-define-module");
+  process_use_modules_var = scm_c_lookup ("process-use-modules");
+  module_export_x_var = scm_c_lookup ("module-export!");
+  the_root_module_var = scm_c_lookup ("the-root-module");
+  default_duplicate_binding_procedures_var = 
+    scm_c_lookup ("default-duplicate-binding-procedures");
 
   scm_module_system_booted_p = 1;
 }
diff --git a/libguile/numbers.c b/libguile/numbers.c
index b61b3a7..358a1cd 100644
--- a/libguile/numbers.c
+++ b/libguile/numbers.c
@@ -98,6 +98,8 @@
 /* the macro above will not work as is with fractions */
 
 
+static SCM flo0;
+
 #define SCM_SWAP(x, y) do { SCM __t = x; x = y; y = __t; } while (0)
 
 /* FLOBUFLEN is the maximum number of characters neccessary for the
@@ -5828,7 +5830,7 @@ scm_imag_part (SCM z)
   else if (SCM_BIGP (z))
     return SCM_INUM0;
   else if (SCM_REALP (z))
-    return scm_flo0;
+    return flo0;
   else if (SCM_COMPLEXP (z))
     return scm_from_double (SCM_COMPLEX_IMAG (z));
   else if (SCM_FRACTIONP (z))
@@ -5923,13 +5925,13 @@ SCM
 scm_angle (SCM z)
 {
   /* atan(0,-1) is pi and it'd be possible to have that as a constant like
-     scm_flo0 to save allocating a new flonum with scm_from_double each time.
+     flo0 to save allocating a new flonum with scm_from_double each time.
      But if atan2 follows the floating point rounding mode, then the value
      is not a constant.  Maybe it'd be close enough though.  */
   if (SCM_I_INUMP (z))
     {
       if (SCM_I_INUM (z) >= 0)
-        return scm_flo0;
+        return flo0;
       else
        return scm_from_double (atan2 (0.0, -1.0));
     }
@@ -5940,12 +5942,12 @@ scm_angle (SCM z)
       if (sgn < 0)
        return scm_from_double (atan2 (0.0, -1.0));
       else
-        return scm_flo0;
+        return flo0;
     }
   else if (SCM_REALP (z))
     {
       if (SCM_REAL_VALUE (z) >= 0)
-        return scm_flo0;
+        return flo0;
       else
         return scm_from_double (atan2 (0.0, -1.0));
     }
@@ -5954,7 +5956,7 @@ scm_angle (SCM z)
   else if (SCM_FRACTIONP (z))
     {
       if (scm_is_false (scm_negative_p (SCM_FRACTION_NUMERATOR (z))))
-       return scm_flo0;
+       return flo0;
       else return scm_from_double (atan2 (0.0, -1.0));
     }
   else
@@ -6594,7 +6596,7 @@ scm_init_numbers ()
 
   scm_add_feature ("complex");
   scm_add_feature ("inexact");
-  scm_flo0 = scm_from_double (0.0);
+  flo0 = scm_from_double (0.0);
 
   /* determine floating point precision */
   for (i=2; i <= SCM_MAX_DBL_RADIX; ++i)
@@ -6604,11 +6606,10 @@ scm_init_numbers ()
     }
 #ifdef DBL_DIG
   /* hard code precision for base 10 if the preprocessor tells us to... */
-      scm_dblprec[10-2] = (DBL_DIG > 20) ? 20 : DBL_DIG;
+  scm_dblprec[10-2] = (DBL_DIG > 20) ? 20 : DBL_DIG;
 #endif
 
-  exactly_one_half = scm_permanent_object (scm_divide (SCM_I_MAKINUM (1),
-                                                      SCM_I_MAKINUM (2)));
+  exactly_one_half = scm_divide (SCM_I_MAKINUM (1), SCM_I_MAKINUM (2));
 #include "libguile/numbers.x"
 }
 
diff --git a/libguile/objprop.c b/libguile/objprop.c
index 6dd1da6..39fcfb5 100644
--- a/libguile/objprop.c
+++ b/libguile/objprop.c
@@ -1,4 +1,4 @@
-/*     Copyright (C) 1995,1996, 2000, 2001, 2003, 2006, 2008 Free Software 
Foundation, Inc.
+/*     Copyright (C) 1995,1996, 2000, 2001, 2003, 2006, 2008, 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
@@ -35,12 +35,14 @@
 /* {Object Properties}
  */
 
+static SCM object_whash;
+
 SCM_DEFINE (scm_object_properties, "object-properties", 1, 0, 0, 
            (SCM obj),
            "Return @var{obj}'s property list.")
 #define FUNC_NAME s_scm_object_properties
 {
-  return scm_hashq_ref (scm_object_whash, obj, SCM_EOL);
+  return scm_hashq_ref (object_whash, obj, SCM_EOL);
 }
 #undef FUNC_NAME
 
@@ -50,7 +52,7 @@ SCM_DEFINE (scm_set_object_properties_x, 
"set-object-properties!", 2, 0, 0,
            "Set @var{obj}'s property list to @var{alist}.")
 #define FUNC_NAME s_scm_set_object_properties_x
 {
-  SCM handle = scm_hashq_create_handle_x (scm_object_whash, obj, alist);
+  SCM handle = scm_hashq_create_handle_x (object_whash, obj, alist);
   SCM_SETCDR (handle, alist);
   return alist;
 }
@@ -75,7 +77,7 @@ SCM_DEFINE (scm_set_object_property_x, 
"set-object-property!", 3, 0, 0,
 {
   SCM h;
   SCM assoc;
-  h = scm_hashq_create_handle_x (scm_object_whash, obj, SCM_EOL);
+  h = scm_hashq_create_handle_x (object_whash, obj, SCM_EOL);
   SCM_CRITICAL_SECTION_START;
   assoc = scm_assq (key, SCM_CDR (h));
   if (SCM_NIMP (assoc))
@@ -94,7 +96,7 @@ SCM_DEFINE (scm_set_object_property_x, 
"set-object-property!", 3, 0, 0,
 void
 scm_init_objprop ()
 {
-  scm_object_whash = scm_make_weak_key_hash_table (SCM_UNDEFINED);
+  object_whash = scm_make_weak_key_hash_table (SCM_UNDEFINED);
 #include "libguile/objprop.x"
 }
 
diff --git a/libguile/options.c b/libguile/options.c
index ee7001a..ba2e95e 100644
--- a/libguile/options.c
+++ b/libguile/options.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995,1996,1998,2000,2001, 2006, 2008 Free Software Foundation
+/* Copyright (C) 1995,1996,1998,2000,2001, 2006, 2008, 2009 Free Software 
Foundation
  * 
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public License
@@ -281,7 +281,6 @@ scm_init_opts (SCM (*func) (SCM), scm_t_option options[])
     {
       SCM name = scm_from_locale_symbol (options[i].name);
       options[i].name =        (char *) SCM_UNPACK (name);
-      scm_permanent_object (name);
     }
   func (SCM_UNDEFINED);
 }
diff --git a/libguile/ports.c b/libguile/ports.c
index 1fd6f63..f56c092 100644
--- a/libguile/ports.c
+++ b/libguile/ports.c
@@ -95,8 +95,8 @@
  * Indexes into this table are used when generating type
  * tags for smobjects (if you know a tag you can get an index and conversely).
  */
-scm_t_ptob_descriptor *scm_ptobs;
-long scm_numptob;
+scm_t_ptob_descriptor *scm_ptobs = NULL;
+long scm_numptob = 0;
 
 /* GC marker for a port with stream of SCM type.  */
 SCM 
@@ -2266,13 +2266,6 @@ scm_port_print (SCM exp, SCM port, scm_print_state 
*pstate SCM_UNUSED)
   return 1;
 }
 
-void
-scm_ports_prehistory ()
-{
-  scm_numptob = 0;
-  scm_ptobs = NULL;
-}
-
 
 
 /* Void ports.   */
@@ -2340,12 +2333,12 @@ scm_init_ports ()
   scm_tc16_void_port = scm_make_port_type ("void", fill_input_void_port, 
                                           write_void_port);
 
-  cur_inport_fluid = scm_permanent_object (scm_make_fluid ());
-  cur_outport_fluid = scm_permanent_object (scm_make_fluid ());
-  cur_errport_fluid = scm_permanent_object (scm_make_fluid ());
-  cur_loadport_fluid = scm_permanent_object (scm_make_fluid ());
+  cur_inport_fluid = scm_make_fluid ();
+  cur_outport_fluid = scm_make_fluid ();
+  cur_errport_fluid = scm_make_fluid ();
+  cur_loadport_fluid = scm_make_fluid ();
 
-  scm_i_port_weak_hash = scm_permanent_object (scm_make_weak_key_hash_table 
(SCM_I_MAKINUM(31)));
+  scm_i_port_weak_hash = scm_make_weak_key_hash_table (SCM_I_MAKINUM(31));
 
 #include "libguile/ports.x"
 
diff --git a/libguile/ports.h b/libguile/ports.h
index 2ac736e..3af3441 100644
--- a/libguile/ports.h
+++ b/libguile/ports.h
@@ -304,7 +304,6 @@ SCM_API SCM scm_port_conversion_strategy (SCM port);
 SCM_API SCM scm_set_port_conversion_strategy_x (SCM port, SCM behavior);
 SCM_API int scm_port_print (SCM exp, SCM port, scm_print_state *);
 SCM_API void scm_print_port_mode (SCM exp, SCM port);
-SCM_API void scm_ports_prehistory (void);
 SCM_API SCM scm_void_port (char * mode_str);
 SCM_API SCM scm_sys_make_void_port (SCM mode);
 SCM_INTERNAL void scm_init_ports (void);
diff --git a/libguile/print.c b/libguile/print.c
index a268a0c..8d2db13 100644
--- a/libguile/print.c
+++ b/libguile/print.c
@@ -709,6 +709,15 @@ iprin1 (SCM exp, SCM port, scm_print_state *pstate)
        case scm_tc7_program:
          scm_i_program_print (exp, port, pstate);
          break;
+       case scm_tc7_hashtable:
+         scm_i_hashtable_print (exp, port, pstate);
+         break;
+       case scm_tc7_fluid:
+         scm_i_fluid_print (exp, port, pstate);
+         break;
+       case scm_tc7_dynamic_state:
+         scm_i_dynamic_state_print (exp, port, pstate);
+         break;
        case scm_tc7_wvect:
          ENTER_NESTED_DATA (pstate, exp, circref);
          if (SCM_IS_WHVEC (exp))
diff --git a/libguile/properties.c b/libguile/properties.c
index 60ff2ff..1f3c668 100644
--- a/libguile/properties.c
+++ b/libguile/properties.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995,1996,2000,2001, 2003, 2006, 2008 Free Software 
Foundation, Inc.
+/* Copyright (C) 1995,1996,2000,2001, 2003, 2006, 2008, 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
@@ -36,6 +36,8 @@
 /* {Properties}
  */
 
+static SCM properties_whash;
+
 SCM_DEFINE (scm_primitive_make_property, "primitive-make-property", 1, 0, 0,
            (SCM not_found_proc),
            "Create a @dfn{property token} that can be used with\n"
@@ -67,7 +69,7 @@ SCM_DEFINE (scm_primitive_property_ref, 
"primitive-property-ref", 2, 0, 0,
 
   SCM_VALIDATE_CONS (SCM_ARG1, prop);
 
-  h = scm_hashq_get_handle (scm_properties_whash, obj);
+  h = scm_hashq_get_handle (properties_whash, obj);
   if (scm_is_true (h))
     {
       SCM assoc = scm_assq (prop, SCM_CDR (h));
@@ -81,7 +83,7 @@ SCM_DEFINE (scm_primitive_property_ref, 
"primitive-property-ref", 2, 0, 0,
     {
       SCM val = scm_call_2 (SCM_CAR (prop), prop, obj);
       if (scm_is_false (h))
-       h = scm_hashq_create_handle_x (scm_properties_whash, obj, SCM_EOL);
+       h = scm_hashq_create_handle_x (properties_whash, obj, SCM_EOL);
       SCM_SETCDR (h, scm_acons (prop, val, SCM_CDR (h)));
       return val;
     }
@@ -96,7 +98,7 @@ SCM_DEFINE (scm_primitive_property_set_x, 
"primitive-property-set!", 3, 0, 0,
 {
   SCM h, assoc;
   SCM_VALIDATE_CONS (SCM_ARG1, prop);
-  h = scm_hashq_create_handle_x (scm_properties_whash, obj, SCM_EOL);
+  h = scm_hashq_create_handle_x (properties_whash, obj, SCM_EOL);
   assoc = scm_assq (prop, SCM_CDR (h));
   if (SCM_NIMP (assoc))
     SCM_SETCDR (assoc, val);
@@ -117,7 +119,7 @@ SCM_DEFINE (scm_primitive_property_del_x, 
"primitive-property-del!", 2, 0, 0,
 {
   SCM h;
   SCM_VALIDATE_CONS (SCM_ARG1, prop);
-  h = scm_hashq_get_handle (scm_properties_whash, obj);
+  h = scm_hashq_get_handle (properties_whash, obj);
   if (scm_is_true (h))
     SCM_SETCDR (h, scm_assq_remove_x (SCM_CDR (h), prop));
   return SCM_UNSPECIFIED;
@@ -128,7 +130,7 @@ SCM_DEFINE (scm_primitive_property_del_x, 
"primitive-property-del!", 2, 0, 0,
 void
 scm_init_properties ()
 {
-  scm_properties_whash = scm_make_weak_key_hash_table (SCM_UNDEFINED);
+  properties_whash = scm_make_weak_key_hash_table (SCM_UNDEFINED);
 #include "libguile/properties.x"
 }
 
diff --git a/libguile/root.c b/libguile/root.c
index 83960b5..d35d8e8 100644
--- a/libguile/root.c
+++ b/libguile/root.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995,1996,1997,1998,1999,2000, 2001, 2002, 2006, 2008 Free 
Software Foundation, Inc.
+/* Copyright (C) 1995,1996,1997,1998,1999,2000, 2001, 2002, 2006, 2008, 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
@@ -38,10 +38,6 @@
 #include "libguile/root.h"
 
 
-SCM scm_sys_protects[SCM_NUM_PROTECTS];
-
-
-
 /* {call-with-dynamic-root}
  *
  * Suspending the current thread to evaluate a thunk on the
diff --git a/libguile/root.h b/libguile/root.h
index 46b9be0..68ab5c7 100644
--- a/libguile/root.h
+++ b/libguile/root.h
@@ -29,22 +29,6 @@
 
 
 
-#define scm_flo0 scm_sys_protects[0]
-#define scm_listofnull scm_sys_protects[1]
-#define scm_nullvect scm_sys_protects[2]
-#define scm_nullstr scm_sys_protects[3]
-#define scm_keyword_obarray scm_sys_protects[4]
-#define scm_object_whash scm_sys_protects[5]
-#define scm_asyncs scm_sys_protects[6]
-#define scm_protects scm_sys_protects[7]
-#define scm_properties_whash scm_sys_protects[8]
-#define scm_source_whash scm_sys_protects[9]
-#define SCM_NUM_PROTECTS 10
-
-SCM_API SCM scm_sys_protects[];
-
-
-
 SCM_API SCM scm_internal_cwdr (scm_t_catch_body body,
                               void *body_data,
                               scm_t_catch_handler handler,
diff --git a/libguile/scmsigs.c b/libguile/scmsigs.c
index f38d15c..699a6de 100644
--- a/libguile/scmsigs.c
+++ b/libguile/scmsigs.c
@@ -668,10 +668,8 @@ scm_init_scmsigs ()
   signal_handlers =
     SCM_VARIABLE_LOC (scm_c_define ("signal-handlers",
                                  scm_c_make_vector (NSIG, SCM_BOOL_F)));
-  signal_handler_asyncs =
-    scm_permanent_object (scm_c_make_vector (NSIG, SCM_BOOL_F));
-  signal_handler_threads =
-    scm_permanent_object (scm_c_make_vector (NSIG, SCM_BOOL_F));
+  signal_handler_asyncs = scm_c_make_vector (NSIG, SCM_BOOL_F);
+  signal_handler_threads = scm_c_make_vector (NSIG, SCM_BOOL_F);
 
   for (i = 0; i < NSIG; i++)
     {
diff --git a/libguile/snarf.h b/libguile/snarf.h
index 720cff5..ef1fcd0 100644
--- a/libguile/snarf.h
+++ b/libguile/snarf.h
@@ -237,37 +237,37 @@ SCM_SNARF_INIT(                                           
                \
 
 # define SCM_SYMBOL(c_name, scheme_name)                               \
 SCM_SNARF_HERE(static SCM c_name)                                      \
-SCM_SNARF_INIT(c_name = scm_permanent_object (scm_from_locale_symbol 
(scheme_name)))
+SCM_SNARF_INIT(c_name = scm_from_locale_symbol (scheme_name))
 
 # define SCM_GLOBAL_SYMBOL(c_name, scheme_name)                                
\
 SCM_SNARF_HERE(SCM c_name)                                             \
-SCM_SNARF_INIT(c_name = scm_permanent_object (scm_from_locale_symbol 
(scheme_name)))
+SCM_SNARF_INIT(c_name = scm_from_locale_symbol (scheme_name))
 
 #endif /* !SCM_SUPPORT_STATIC_ALLOCATION */
 
 #define SCM_KEYWORD(c_name, scheme_name) \
 SCM_SNARF_HERE(static SCM c_name) \
-SCM_SNARF_INIT(c_name = scm_permanent_object (scm_from_locale_keyword 
(scheme_name)))
+SCM_SNARF_INIT(c_name = scm_from_locale_keyword (scheme_name))
 
 #define SCM_GLOBAL_KEYWORD(c_name, scheme_name) \
 SCM_SNARF_HERE(SCM c_name) \
-SCM_SNARF_INIT(c_name = scm_permanent_object (scm_from_locale_keyword 
(scheme_name)))
+SCM_SNARF_INIT(c_name = scm_from_locale_keyword (scheme_name))
 
 #define SCM_VARIABLE(c_name, scheme_name) \
 SCM_SNARF_HERE(static SCM c_name) \
-SCM_SNARF_INIT(c_name = scm_permanent_object (scm_c_define (scheme_name, 
SCM_BOOL_F));)
+SCM_SNARF_INIT(c_name = scm_c_define (scheme_name, SCM_BOOL_F);)
 
 #define SCM_GLOBAL_VARIABLE(c_name, scheme_name) \
 SCM_SNARF_HERE(SCM c_name) \
-SCM_SNARF_INIT(c_name = scm_permanent_object (scm_c_define (scheme_name, 
SCM_BOOL_F));)
+SCM_SNARF_INIT(c_name = scm_c_define (scheme_name, SCM_BOOL_F);)
 
 #define SCM_VARIABLE_INIT(c_name, scheme_name, init_val) \
 SCM_SNARF_HERE(static SCM c_name) \
-SCM_SNARF_INIT(c_name = scm_permanent_object (scm_c_define (scheme_name, 
init_val));)
+SCM_SNARF_INIT(c_name = scm_c_define (scheme_name, init_val);)
 
 #define SCM_GLOBAL_VARIABLE_INIT(c_name, scheme_name, init_val) \
 SCM_SNARF_HERE(SCM c_name) \
-SCM_SNARF_INIT(c_name = scm_permanent_object (scm_c_define (scheme_name, 
init_val));)
+SCM_SNARF_INIT(c_name = scm_c_define (scheme_name, init_val);)
 
 #define SCM_MUTEX(c_name) \
 SCM_SNARF_HERE(static scm_t_mutex c_name) \
diff --git a/libguile/srcprop.c b/libguile/srcprop.c
index 1103864..b57fc32 100644
--- a/libguile/srcprop.c
+++ b/libguile/srcprop.c
@@ -59,6 +59,7 @@ SCM_GLOBAL_SYMBOL (scm_sym_copy, "copy");
 SCM_GLOBAL_SYMBOL (scm_sym_line, "line");
 SCM_GLOBAL_SYMBOL (scm_sym_column, "column");
 SCM_GLOBAL_SYMBOL (scm_sym_breakpoint, "breakpoint");
+SCM scm_source_whash;
 
 
 
@@ -331,9 +332,8 @@ scm_init_srcprop ()
   scm_source_whash = scm_make_weak_key_hash_table (scm_from_int (2047));
   scm_c_define ("source-whash", scm_source_whash);
 
-  scm_last_alist_filename
-    = scm_permanent_object (scm_cons (SCM_EOL,
-                                     scm_acons (SCM_EOL, SCM_EOL, SCM_EOL)));
+  scm_last_alist_filename = scm_cons (SCM_EOL,
+                                     scm_acons (SCM_EOL, SCM_EOL, SCM_EOL));
 
 #include "libguile/srcprop.x"
 }
diff --git a/libguile/srcprop.h b/libguile/srcprop.h
index a0f4772..34538d0 100644
--- a/libguile/srcprop.h
+++ b/libguile/srcprop.h
@@ -57,6 +57,7 @@ do { \
 #define SCM_SOURCE_PROPERTY_FLAG_BREAK 1
 
 SCM_API scm_t_bits scm_tc16_srcprops;
+SCM_INTERNAL SCM scm_source_whash;
 
 SCM_API SCM scm_sym_filename;
 SCM_API SCM scm_sym_copy;
diff --git a/libguile/srfi-14.c b/libguile/srfi-14.c
index 38ef320..09fe90c 100644
--- a/libguile/srfi-14.c
+++ b/libguile/srfi-14.c
@@ -2010,7 +2010,7 @@ define_charset (const char *name, const scm_t_char_set *p)
 
   SCM_NEWSMOB (cs, scm_tc16_charset, p);
   scm_c_define (name, cs);
-  return scm_permanent_object (cs);
+  return cs;
 }
 
 SCM_DEFINE (scm_sys_char_set_dump, "%char-set-dump", 1, 0, 0, (SCM charset), 
diff --git a/libguile/srfi-4.c b/libguile/srfi-4.c
index af8eaa3..b247991 100644
--- a/libguile/srfi-4.c
+++ b/libguile/srfi-4.c
@@ -895,14 +895,10 @@ scm_init_srfi_4 (void)
   scm_set_smob_print (scm_tc16_uvec, uvec_print);
 
 #if SCM_HAVE_T_INT64 == 0
-  scm_uint64_min =
-    scm_permanent_object (scm_from_int (0));
-  scm_uint64_max =
-    scm_permanent_object (scm_c_read_string ("18446744073709551615"));
-  scm_int64_min =
-    scm_permanent_object (scm_c_read_string ("-9223372036854775808"));
-  scm_int64_max =
-    scm_permanent_object (scm_c_read_string ("9223372036854775807"));
+  scm_uint64_min = scm_from_int (0);
+  scm_uint64_max = scm_c_read_string ("18446744073709551615");
+  scm_int64_min = scm_c_read_string ("-9223372036854775808");
+  scm_int64_max = scm_c_read_string ("9223372036854775807");
 #endif
 
 #define REGISTER(tag, TAG)                                       \
diff --git a/libguile/stacks.c b/libguile/stacks.c
index 21c288f..60f0159 100644
--- a/libguile/stacks.c
+++ b/libguile/stacks.c
@@ -375,10 +375,8 @@ SCM_DEFINE (scm_stack_length, "stack-length", 1, 0, 0,
 void
 scm_init_stacks ()
 {
-  scm_stack_type =
-    scm_permanent_object
-    (scm_make_vtable (scm_from_locale_string (SCM_STACK_LAYOUT),
-                      SCM_UNDEFINED));
+  scm_stack_type = scm_make_vtable (scm_from_locale_string (SCM_STACK_LAYOUT),
+                                    SCM_UNDEFINED);
   scm_set_struct_vtable_name_x (scm_stack_type,
                                scm_from_locale_symbol ("stack"));
 #include "libguile/stacks.x"
diff --git a/libguile/strings.c b/libguile/strings.c
index 0ea50fd..651b019 100644
--- a/libguile/strings.c
+++ b/libguile/strings.c
@@ -253,6 +253,8 @@ scm_i_pthread_mutex_t stringbuf_write_mutex = 
SCM_I_PTHREAD_MUTEX_INITIALIZER;
 
 #define IS_SH_STRING(str)   (SCM_CELL_TYPE(str)==SH_STRING_TAG)
 
+SCM scm_nullstr;
+
 /* Create a scheme string with space for LEN 8-bit Latin-1-encoded
    characters.  CHARSP, if not NULL, will be set to location of the
    char array.  */
diff --git a/libguile/strings.h b/libguile/strings.h
index 601bd9c..edff0f8 100644
--- a/libguile/strings.h
+++ b/libguile/strings.h
@@ -98,6 +98,8 @@ typedef enum
   SCM_FAILED_CONVERSION_ESCAPE_SEQUENCE = SCM_ICONVEH_ESCAPE_SEQUENCE
 } scm_t_string_failed_conversion_handler;
 
+SCM_INTERNAL SCM scm_nullstr;
+
 SCM_API SCM scm_string_p (SCM x);
 SCM_API SCM scm_string (SCM chrs);
 SCM_API SCM scm_make_string (SCM k, SCM chr);
diff --git a/libguile/struct.c b/libguile/struct.c
index 9fd73a6..cd2c441 100644
--- a/libguile/struct.c
+++ b/libguile/struct.c
@@ -854,12 +854,6 @@ scm_print_struct (SCM exp, SCM port, scm_print_state 
*pstate)
 }
 
 void
-scm_struct_prehistory ()
-{
-  /* Empty.  */
-}
-
-void
 scm_init_struct ()
 {
   SCM scm_applicable_struct_vtable_vtable;
diff --git a/libguile/struct.h b/libguile/struct.h
index 9372cec..1e80fc1 100644
--- a/libguile/struct.h
+++ b/libguile/struct.h
@@ -157,7 +157,6 @@ SCM_API SCM scm_struct_create_handle (SCM obj);
 SCM_API SCM scm_struct_vtable_name (SCM vtable);
 SCM_API SCM scm_set_struct_vtable_name_x (SCM vtable, SCM name);
 SCM_API void scm_print_struct (SCM exp, SCM port, scm_print_state *);
-SCM_API void scm_struct_prehistory (void);
 
 SCM_INTERNAL SCM scm_i_struct_equalp (SCM s1, SCM s2);
 SCM_INTERNAL unsigned long scm_struct_ihashq (SCM, unsigned long, void *);
diff --git a/libguile/tags.h b/libguile/tags.h
index 915f6f3..5020775 100644
--- a/libguile/tags.h
+++ b/libguile/tags.h
@@ -411,15 +411,11 @@ typedef scm_t_uintptr scm_t_bits;
 #define scm_tc7_stringbuf       39
 #define scm_tc7_bytevector     77
 
-/* Many of the following should be turned
- * into structs or smobs.  We need back some
- * of these 7 bit tags!  */
-
 #define scm_tc7_pws            31
+#define scm_tc7_hashtable      29
+#define scm_tc7_fluid          37
+#define scm_tc7_dynamic_state  45
 
-#define scm_tc7_unused_1        29
-#define scm_tc7_unused_2       37
-#define scm_tc7_unused_3       45
 #define scm_tc7_unused_4       47
 #define scm_tc7_unused_5       53
 #define scm_tc7_unused_6       55
diff --git a/libguile/threads.c b/libguile/threads.c
index bf2fdb2..f9344e4 100644
--- a/libguile/threads.c
+++ b/libguile/threads.c
@@ -1947,15 +1947,14 @@ scm_init_threads ()
   guilify_self_2 (SCM_BOOL_F);
   threads_initialized_p = 1;
 
-  dynwind_critical_section_mutex =
-    scm_permanent_object (scm_make_recursive_mutex ());
+  dynwind_critical_section_mutex = scm_make_recursive_mutex ();
 }
 
 void
 scm_init_threads_default_dynamic_state ()
 {
   SCM state = scm_make_dynamic_state (scm_current_dynamic_state ());
-  scm_i_default_dynamic_state = scm_permanent_object (state);
+  scm_i_default_dynamic_state = state;
 }
 
 void
diff --git a/libguile/vectors.c b/libguile/vectors.c
index 405ebb1..fddf0ce 100644
--- a/libguile/vectors.c
+++ b/libguile/vectors.c
@@ -637,8 +637,6 @@ SCM_VECTOR_IMPLEMENTATION (SCM_ARRAY_ELEMENT_TYPE_SCM, 
scm_make_vector);
 void
 scm_init_vectors ()
 {
-  scm_nullvect = scm_c_make_vector (0, SCM_UNDEFINED);
-
 #include "libguile/vectors.x"
 }
 
diff --git a/libguile/vm.c b/libguile/vm.c
index 37f74e5..0e511f6 100644
--- a/libguile/vm.c
+++ b/libguile/vm.c
@@ -212,7 +212,7 @@ vm_make_boot_program (long nargs)
     {
       int i;
       for (i = 0; i < NUM_BOOT_PROGS; i++)
-        programs[i] = scm_permanent_object (really_make_boot_program (i));
+        programs[i] = really_make_boot_program (i);
     }
   
   if (SCM_LIKELY (nargs < NUM_BOOT_PROGS))
@@ -685,9 +685,9 @@ scm_bootstrap_vm (void)
                 scm_c_make_gsubr ("load-compiled/vm", 1, 0, 0,
                                   scm_load_compiled_with_vm));
 
-  sym_vm_run = scm_permanent_object (scm_from_locale_symbol ("vm-run"));
-  sym_vm_error = scm_permanent_object (scm_from_locale_symbol ("vm-error"));
-  sym_debug = scm_permanent_object (scm_from_locale_symbol ("debug"));
+  sym_vm_run = scm_from_locale_symbol ("vm-run");
+  sym_vm_error = scm_from_locale_symbol ("vm-error");
+  sym_debug = scm_from_locale_symbol ("debug");
 
   scm_c_register_extension ("libguile", "scm_init_vm",
                             (scm_t_extension_init_func)scm_init_vm, NULL);


hooks/post-receive
-- 
GNU Guile




reply via email to

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