Merge branch 'master' into boehm-demers-weiser-gc
authorLudovic Courtès <ludo@gnu.org>
Mon, 17 Aug 2009 21:39:56 +0000 (23:39 +0200)
committerLudovic Courtès <ludo@gnu.org>
Mon, 17 Aug 2009 22:06:45 +0000 (00:06 +0200)
Conflicts:
lib/Makefile.am
libguile/Makefile.am
libguile/frames.c
libguile/gc-card.c
libguile/gc-freelist.c
libguile/gc-mark.c
libguile/gc-segment.c
libguile/gc_os_dep.c
libguile/load.c
libguile/macros.c
libguile/objcodes.c
libguile/programs.c
libguile/strings.c
libguile/vm.c
m4/gnulib-cache.m4
m4/gnulib-comp.m4
m4/inline.m4

77 files changed:
1  2 
GUILE-VERSION
configure.ac
lib/Makefile.am
libguile/Makefile.am
libguile/arbiters.c
libguile/async.c
libguile/continuations.c
libguile/debug.c
libguile/dynl.c
libguile/dynwind.c
libguile/environments.c
libguile/environments.h
libguile/eval.c
libguile/fluids.c
libguile/fluids.h
libguile/fports.c
libguile/frames.c
libguile/futures.c
libguile/gc-malloc.c
libguile/gc.c
libguile/gc.h
libguile/gdbint.c
libguile/goops.c
libguile/guardians.c
libguile/hashtab.c
libguile/hashtab.h
libguile/hooks.c
libguile/i18n.c
libguile/init.c
libguile/inline.h
libguile/keywords.c
libguile/load.c
libguile/macros.c
libguile/mallocs.c
libguile/modules.c
libguile/numbers.c
libguile/objcodes.c
libguile/objects.c
libguile/ports.c
libguile/ports.h
libguile/posix.c
libguile/print.c
libguile/private-gc.h
libguile/procs.c
libguile/procs.h
libguile/programs.c
libguile/pthread-threads.h
libguile/random.c
libguile/regex-posix.c
libguile/root.h
libguile/simpos.c
libguile/smob.c
libguile/smob.h
libguile/srcprop.c
libguile/srfi-14.c
libguile/srfi-4.c
libguile/strings.c
libguile/strings.h
libguile/struct.c
libguile/struct.h
libguile/symbols.c
libguile/threads.c
libguile/threads.h
libguile/unif.c
libguile/vectors.c
libguile/vectors.h
libguile/version.c
libguile/vm.c
libguile/weaks.c
libguile/weaks.h
m4/gnulib-cache.m4
m4/gnulib-comp.m4
module/ice-9/boot-9.scm
test-suite/Makefile.am
test-suite/tests/environments.nottest
test-suite/tests/gc.test
test-suite/tests/guardians.test

diff --cc GUILE-VERSION
@@@ -2,10 -2,10 +2,10 @@@
  
  GUILE_MAJOR_VERSION=1
  GUILE_MINOR_VERSION=9
- GUILE_MICRO_VERSION=0
+ GUILE_MICRO_VERSION=2
  
  GUILE_EFFECTIVE_VERSION=${GUILE_MAJOR_VERSION}.${GUILE_MINOR_VERSION}
 -GUILE_VERSION=${GUILE_EFFECTIVE_VERSION}.${GUILE_MICRO_VERSION}
 +GUILE_VERSION=${GUILE_EFFECTIVE_VERSION}.${GUILE_MICRO_VERSION}-bdwgc
  
  # For automake.
  VERSION=${GUILE_VERSION}
diff --cc configure.ac
Simple merge
diff --cc lib/Makefile.am
@@@ -9,9 -9,9 +9,9 @@@
  # the same distribution terms as the rest of that program.
  #
  # Generated by gnulib-tool.
- # Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl --libtool --macro-prefix=gl --no-vc-files alloca-opt autobuild extensions full-read full-write strcase strftime
 -# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl --libtool --macro-prefix=gl --no-vc-files alloca-opt autobuild byteswap canonicalize-lgpl count-one-bits environ extensions flock fpieee full-read full-write havelib iconv_open-utf lib-symbol-versions lib-symbol-visibility libunistring putenv stdlib strcase strftime striconveh string verify vsnprintf
++# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl --libtool --macro-prefix=gl --no-vc-files alloca-opt autobuild byteswap canonicalize-lgpl environ extensions flock fpieee full-read full-write havelib iconv_open-utf lib-symbol-versions lib-symbol-visibility libunistring putenv stdlib strcase strftime striconveh string verify vsnprintf
  
- AUTOMAKE_OPTIONS = 1.5 gnits
+ AUTOMAKE_OPTIONS = 1.5 gnits subdir-objects
  
  SUBDIRS =
  noinst_HEADERS =
@@@ -109,6 -160,70 +160,63 @@@ CLEANFILES += configmake.h configmake.h
  
  ## end   gnulib module configmake
  
 -## begin gnulib module count-one-bits
 -
 -
 -EXTRA_DIST += count-one-bits.h
 -
 -## end   gnulib module count-one-bits
 -
+ ## begin gnulib module errno
+ BUILT_SOURCES += $(ERRNO_H)
+ # We need the following in order to create <errno.h> when the system
+ # doesn't have one that is POSIX compliant.
+ errno.h: errno.in.h
+       rm -f $@-t $@
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+         sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+             -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''NEXT_ERRNO_H''@|$(NEXT_ERRNO_H)|g' \
+             -e 's|@''EMULTIHOP_HIDDEN''@|$(EMULTIHOP_HIDDEN)|g' \
+             -e 's|@''EMULTIHOP_VALUE''@|$(EMULTIHOP_VALUE)|g' \
+             -e 's|@''ENOLINK_HIDDEN''@|$(ENOLINK_HIDDEN)|g' \
+             -e 's|@''ENOLINK_VALUE''@|$(ENOLINK_VALUE)|g' \
+             -e 's|@''EOVERFLOW_HIDDEN''@|$(EOVERFLOW_HIDDEN)|g' \
+             -e 's|@''EOVERFLOW_VALUE''@|$(EOVERFLOW_VALUE)|g' \
+             < $(srcdir)/errno.in.h; \
+       } > $@-t
+       mv $@-t $@
+ MOSTLYCLEANFILES += errno.h errno.h-t
+ EXTRA_DIST += errno.in.h
+ ## end   gnulib module errno
+ ## begin gnulib module float
+ BUILT_SOURCES += $(FLOAT_H)
+ # We need the following in order to create <float.h> when the system
+ # doesn't have one that works with the given compiler.
+ float.h: float.in.h
+       rm -f $@-t $@
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+         sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+             -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''NEXT_FLOAT_H''@|$(NEXT_FLOAT_H)|g' \
+             < $(srcdir)/float.in.h; \
+       } > $@-t
+       mv $@-t $@
+ MOSTLYCLEANFILES += float.h float.h-t
+ EXTRA_DIST += float.in.h
+ ## end   gnulib module float
+ ## begin gnulib module flock
+ EXTRA_DIST += flock.c
+ EXTRA_libgnu_la_SOURCES += flock.c
+ ## end   gnulib module flock
  ## begin gnulib module full-read
  
  libgnu_la_SOURCES += full-read.h full-read.c
@@@ -106,11 -106,13 +106,12 @@@ guile_LDFLAGS = $(GUILE_CFLAGS
  libguile_la_CFLAGS = $(GUILE_CFLAGS) $(AM_CFLAGS)
  
  libguile_la_SOURCES = alist.c arbiters.c async.c backtrace.c boolean.c        \
-     chars.c continuations.c convert.c debug.c deprecation.c           \
+     bytevectors.c chars.c continuations.c                             \
+     convert.c debug.c deprecation.c                                   \
      deprecated.c discouraged.c dynwind.c eq.c error.c \
      eval.c evalext.c extensions.c feature.c fluids.c fports.c         \
 -    futures.c gc.c gc-mark.c gc-segment.c gc-malloc.c gc-card.c               \
 -    gc-freelist.c gc_os_dep.c gdbint.c gettext.c gc-segment-table.c     \
 -    goops.c gsubr.c           \
 +    futures.c gc.c gc-malloc.c                                                \
 +    gdbint.c gettext.c goops.c gsubr.c                                        \
      guardians.c hash.c hashtab.c hooks.c init.c inline.c              \
      ioext.c keywords.c lang.c list.c load.c macros.c mallocs.c                \
      modules.c numbers.c objects.c objprop.c options.c pairs.c ports.c \
@@@ -133,11 -136,13 +135,12 @@@ libguile_i18n_v_@LIBGUILE_I18N_MAJOR@_l
     -module -L$(builddir) -lguile                              \
     -version-info @LIBGUILE_I18N_INTERFACE@
  
- DOT_X_FILES = alist.x arbiters.x async.x backtrace.x boolean.x chars.x        \
+ DOT_X_FILES = alist.x arbiters.x async.x backtrace.x boolean.x                \
+     bytevectors.x chars.x                                             \
      continuations.x debug.x deprecation.x deprecated.x discouraged.x  \
 -    dynl.x dynwind.x eq.x error.x eval.x evalext.x    \
 -    extensions.x feature.x fluids.x fports.x futures.x gc.x gc-mark.x \
 -    gc-segment.x gc-malloc.x gc-card.x gettext.x goops.x              \
 -    gsubr.x guardians.x gc-segment-table.x                              \
 +    dynl.x dynwind.x environments.x eq.x error.x eval.x evalext.x     \
 +    extensions.x feature.x fluids.x fports.x futures.x gc.x           \
 +    gettext.x goops.x gsubr.x guardians.x                             \
      hash.x hashtab.x hooks.x i18n.x init.x ioext.x keywords.x lang.x  \
      list.x load.x macros.x mallocs.x modules.x numbers.x objects.x    \
      objprop.x options.x pairs.x ports.x print.x procprop.x procs.x    \
@@@ -220,8 -236,8 +233,8 @@@ pkginclude_HEADERS 
  # These are headers visible as <libguile/mumble.h>.
  modincludedir = $(includedir)/libguile
  modinclude_HEADERS = __scm.h alist.h arbiters.h async.h backtrace.h   \
-     boehm-gc.h                                                                \
 -    boolean.h bytevectors.h chars.h continuations.h convert.h         \
 -    debug.h debug-malloc.h                                            \
++    boehm-gc.h bytevectors.h                                          \
 +    boolean.h chars.h continuations.h convert.h debug.h debug-malloc.h        \
      deprecation.h deprecated.h discouraged.h dynl.h dynwind.h         \
      eq.h error.h eval.h evalext.h extensions.h                \
      feature.h filesys.h fluids.h fports.h futures.h gc.h              \
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc libguile/dynl.c
@@@ -1,15 -1,15 +1,15 @@@
  /* dynl.c - dynamic linking
   *
   * Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002,
 - * 2003, 2008 Free Software Foundation, Inc.
 + * 2003, 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 as published by the Free Software Foundation; either
-  * version 2.1 of the License, or (at your option) any later version.
+  * modify it under the terms of the GNU Lesser General Public License
+  * as published by the Free Software Foundation; either version 3 of
+  * the License, or (at your option) any later version.
   *
-  * This library is distributed in the hope that it will be useful,
-  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * This library is distributed in the hope that it will be useful, but
+  * WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   * Lesser General Public License for more details.
   *
Simple merge
Simple merge
Simple merge
diff --cc libguile/eval.c
Simple merge
@@@ -1,12 -1,12 +1,12 @@@
 -/* Copyright (C) 1996,1997,2000,2001, 2004, 2006, 2007, 2008 Free Software Foundation, Inc.
 +/* Copyright (C) 1996,1997,2000,2001, 2004, 2006, 2007, 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 as published by the Free Software Foundation; either
-  * version 2.1 of the License, or (at your option) any later version.
+  * modify it under the terms of the GNU Lesser General Public License
+  * as published by the Free Software Foundation; either version 3 of
+  * the License, or (at your option) any later version.
   *
-  * This library is distributed in the hope that it will be useful,
-  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * This library is distributed in the hope that it will be useful, but
+  * WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   * Lesser General Public License for more details.
   *
Simple merge
Simple merge
@@@ -281,7 -263,11 +250,9 @@@ voi
  scm_bootstrap_frames (void)
  {
    scm_tc16_vm_frame = scm_make_smob_type ("vm-frame", 0);
 -  scm_set_smob_mark (scm_tc16_vm_frame, vm_frame_mark);
 -  scm_set_smob_free (scm_tc16_vm_frame, vm_frame_free);
    scm_set_smob_print (scm_tc16_vm_frame, vm_frame_print);
+   scm_c_register_extension ("libguile", "scm_init_frames",
+                             (scm_t_extension_init_func)scm_init_frames, NULL);
  }
  
  void
Simple merge
Simple merge
diff --cc libguile/gc.c
@@@ -1,12 -1,12 +1,12 @@@
 -/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001, 2002, 2003, 2006, 2008 Free Software Foundation, Inc.
 +/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001, 2002, 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 as published by the Free Software Foundation; either
-  * version 2.1 of the License, or (at your option) any later version.
+  * modify it under the terms of the GNU Lesser General Public License
+  * as published by the Free Software Foundation; either version 3 of
+  * the License, or (at your option) any later version.
   *
-  * This library is distributed in the hope that it will be useful,
-  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * This library is distributed in the hope that it will be useful, but
+  * WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   * Lesser General Public License for more details.
   *
diff --cc libguile/gc.h
@@@ -3,15 -3,15 +3,15 @@@
  #ifndef SCM_GC_H
  #define SCM_GC_H
  
 -/* Copyright (C) 1995,1996,1998,1999,2000,2001, 2002, 2003, 2004, 2006, 2008 Free Software Foundation, Inc.
 +/* Copyright (C) 1995,1996,1998,1999,2000,2001, 2002, 2003, 2004, 2006, 2007, 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 as published by the Free Software Foundation; either
-  * version 2.1 of the License, or (at your option) any later version.
+  * modify it under the terms of the GNU Lesser General Public License
+  * as published by the Free Software Foundation; either version 3 of
+  * the License, or (at your option) any later version.
   *
-  * This library is distributed in the hope that it will be useful,
-  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * This library is distributed in the hope that it will be useful, but
+  * WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   * Lesser General Public License for more details.
   *
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -1,12 -1,12 +1,12 @@@
 -/* Copyright (C) 1995,1996,1998,1999,2000,2001, 2003, 2006, 2008 Free Software Foundation, Inc.
 +/* Copyright (C) 1995,1996,1998,1999,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 as published by the Free Software Foundation; either
-  * version 2.1 of the License, or (at your option) any later version.
+  * modify it under the terms of the GNU Lesser General Public License
+  * as published by the Free Software Foundation; either version 3 of
+  * the License, or (at your option) any later version.
   *
-  * This library is distributed in the hope that it will be useful,
-  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * This library is distributed in the hope that it will be useful, but
+  * WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   * Lesser General Public License for more details.
   *
diff --cc libguile/i18n.c
@@@ -1,12 -1,12 +1,12 @@@
 -/* Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
 +/* Copyright (C) 2006, 2007, 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 as published by the Free Software Foundation; either
-  * version 2.1 of the License, or (at your option) any later version.
+  * modify it under the terms of the GNU Lesser General Public License
+  * as published by the Free Software Foundation; either version 3 of
+  * the License, or (at your option) any later version.
   *
-  * This library is distributed in the hope that it will be useful,
-  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * This library is distributed in the hope that it will be useful, but
+  * WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   * Lesser General Public License for more details.
   *
diff --cc libguile/init.c
Simple merge
Simple merge
Simple merge
diff --cc libguile/load.c
@@@ -1,12 -1,12 +1,12 @@@
- /* Copyright (C) 1995,1996,1998,1999,2000,2001, 2004, 2006, 2008 Free Software Foundation, Inc.
 -/* Copyright (C) 1995,1996,1998,1999,2000,2001, 2004, 2006, 2009 Free Software Foundation, Inc.
++/* Copyright (C) 1995,1996,1998,1999,2000,2001, 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 as published by the Free Software Foundation; either
-  * version 2.1 of the License, or (at your option) any later version.
+  * modify it under the terms of the GNU Lesser General Public License
+  * as published by the Free Software Foundation; either version 3 of
+  * the License, or (at your option) any later version.
   *
-  * This library is distributed in the hope that it will be useful,
-  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * This library is distributed in the hope that it will be useful, but
+  * WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   * Lesser General Public License for more details.
   *
@@@ -605,8 -794,15 +794,14 @@@ scm_init_load (
                                      scm_list_1 (scm_from_locale_string (".go"))));
    scm_loc_load_hook = SCM_VARIABLE_LOC (scm_c_define ("%load-hook", SCM_BOOL_F));
  
+   scm_loc_compile_fallback_path
+     = SCM_VARIABLE_LOC (scm_c_define ("%compile-fallback-path", SCM_BOOL_F));
+   scm_loc_load_should_autocompile
+     = SCM_VARIABLE_LOC (scm_c_define ("%load-should-autocompile", SCM_BOOL_F));
    the_reader = scm_make_fluid ();
 -  the_reader_fluid_num = SCM_FLUID_NUM (the_reader);
 -  SCM_FAST_FLUID_SET_X (the_reader_fluid_num, SCM_BOOL_F);
 +  scm_fluid_set_x (the_reader, SCM_BOOL_F);
    scm_c_define("current-reader", the_reader);
  
    init_build_info ();
@@@ -1,12 -1,12 +1,12 @@@
--/* Copyright (C) 1995,1996,1997,1998,2000,2001,2002,2003, 2006, 2008 Free Software Foundation, Inc.
++/* Copyright (C) 1995,1996,1997,1998,2000,2001,2002,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 as published by the Free Software Foundation; either
-  * version 2.1 of the License, or (at your option) any later version.
+  * modify it under the terms of the GNU Lesser General Public License
+  * as published by the Free Software Foundation; either version 3 of
+  * the License, or (at your option) any later version.
   *
-  * This library is distributed in the hope that it will be useful,
-  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * This library is distributed in the hope that it will be useful, but
+  * WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   * Lesser General Public License for more details.
   *
Simple merge
Simple merge
Simple merge
@@@ -259,6 -264,9 +258,8 @@@ voi
  scm_bootstrap_objcodes (void)
  {
    scm_tc16_objcode = scm_make_smob_type ("objcode", 0);
 -  scm_set_smob_mark (scm_tc16_objcode, objcode_mark);
+   scm_c_register_extension ("libguile", "scm_init_objcodes",
+                             (scm_t_extension_init_func)scm_init_objcodes, NULL);
  }
  
  /* Before, we used __BYTE_ORDER, but that is not defined on all
Simple merge
Simple merge
Simple merge
@@@ -1,12 -1,12 +1,12 @@@
 -/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 +/* 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
-  * modify it under the terms of the GNU Lesser General Public
-  * License as published by the Free Software Foundation; either
-  * version 2.1 of the License, or (at your option) any later version.
+  * modify it under the terms of the GNU Lesser General Public License
+  * as published by the Free Software Foundation; either version 3 of
+  * the License, or (at your option) any later version.
   *
-  * This library is distributed in the hope that it will be useful,
-  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * This library is distributed in the hope that it will be useful, but
+  * WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   * Lesser General Public License for more details.
   *
Simple merge
@@@ -103,17 -165,117 +104,16 @@@ typedef enum { return_on_error, abort_o
    gc-mark
   */
  
- /* this can be used to ensure that set/clear gc marks only happen when
-    allowed. */
- int scm_i_marking;
+ /* Non-zero while in the mark phase.  */
+ SCM_INTERNAL int scm_i_marking;
  
- void scm_mark_all (void);
SCM_INTERNAL void scm_mark_all (void);
  
 -/*
 -gc-segment:
 -*/
 -
 -/*
 -
 - Cells are stored in a heap-segment: it is a contiguous chunk of
 - memory, that associated with one freelist. 
 -*/
 -typedef struct scm_t_heap_segment
 -{
 -  /*
 -    {lower, upper} bounds of the segment
 -
 -    The upper bound is also the start of the mark space.
 -  */
 -  scm_t_cell *bounds[2];
 -
 -  /*
 -    If we ever decide to give it back, we could do it with this ptr.
 -
 -    Note that giving back memory is not very useful; as long we don't
 -    touch a chunk of memory, the virtual memory system will keep it
 -    swapped out. We could simply forget about a block.
 -
 -    (not that we do that, but anyway.) 
 -   */
 -  void *malloced;
 -
 -  scm_t_cell *next_free_card;
 -  
 -  /* address of the head-of-freelist pointer for this segment's cells.
 -     All segments usually point to the same one, scm_i_freelist.  */
 -  scm_t_cell_type_statistics *freelist;
 -  
 -  /* number of cells per object in this segment */
 -  int span;
 -
 -  /*
 -    Is this the first time that the cells are accessed? 
 -   */
 -  int first_time;
 -} scm_t_heap_segment;
 +extern long int scm_i_deprecated_memory_return;
 +extern long int scm_i_find_heap_calls;
  
 -/*
 -  A table of segment records is kept that records the upper and
 -  lower extents of the segment;  this is used during the conservative
 -  phase of gc to identify probably gc roots (because they point
 -  into valid segments at reasonable offsets).
 -*/
 -extern scm_t_heap_segment ** scm_i_heap_segment_table;
 -extern size_t scm_i_heap_segment_table_size;
 -
 -
 -SCM_INTERNAL int scm_i_init_card_freelist (scm_t_cell * card, SCM *free_list,
 -                                         scm_t_heap_segment*);
 -SCM_INTERNAL int scm_i_sweep_card (scm_t_cell *card, SCM *free_list,
 -                                 scm_t_heap_segment *);
 -SCM_INTERNAL int scm_i_card_marked_count (scm_t_cell *card, int span);
 -SCM_INTERNAL void scm_i_card_statistics (scm_t_cell *p, SCM hashtab,
 -                                       scm_t_heap_segment *seg);
  SCM_INTERNAL char const *scm_i_tag_name (scm_t_bits tag); /* MOVEME */
  
 -SCM_INTERNAL int scm_i_initialize_heap_segment_data (scm_t_heap_segment *seg,
 -                                                   size_t requested);
 -
 -SCM_INTERNAL int scm_i_segment_cells_per_card (scm_t_heap_segment *seg);
 -SCM_INTERNAL int scm_i_segment_card_number (scm_t_heap_segment *seg,
 -                                          scm_t_cell *card);
 -SCM_INTERNAL int scm_i_segment_card_count (scm_t_heap_segment *seg);
 -SCM_INTERNAL int scm_i_segment_cell_count (scm_t_heap_segment *seg);
 -SCM_INTERNAL int scm_i_heap_segment_marked_count (scm_t_heap_segment *seg);
 -  
 -SCM_INTERNAL void scm_i_clear_segment_mark_space (scm_t_heap_segment *seg);
 -SCM_INTERNAL scm_t_heap_segment *
 -scm_i_make_empty_heap_segment (scm_t_cell_type_statistics*);
 -SCM_INTERNAL SCM scm_i_sweep_for_freelist (scm_t_cell_type_statistics *seg);
 -SCM_INTERNAL SCM scm_i_sweep_some_cards (scm_t_heap_segment *seg,
 -                                       scm_t_sweep_statistics *sweep_stats,
 -                                       int threshold);
 -SCM_INTERNAL void scm_i_sweep_segment (scm_t_heap_segment *seg,
 -                                     scm_t_sweep_statistics *sweep_stats);
 -
 -SCM_INTERNAL void scm_i_heap_segment_statistics (scm_t_heap_segment *seg,
 -                                               SCM tab);
 -
 -
 -SCM_INTERNAL int scm_i_insert_segment (scm_t_heap_segment *seg);
 -SCM_INTERNAL int scm_i_find_heap_segment_containing_object (SCM obj);
 -SCM_INTERNAL int scm_i_get_new_heap_segment (scm_t_cell_type_statistics *freelist,
 -                                           size_t length, 
 -                                           policy_on_error);
 -SCM_INTERNAL int scm_i_marked_count (void);
 -SCM_INTERNAL void scm_i_clear_mark_space (void);
 -SCM_INTERNAL void scm_i_sweep_segments (void);
 -SCM_INTERNAL SCM scm_i_sweep_some_segments (scm_t_cell_type_statistics *fl,
 -                                          scm_t_sweep_statistics *sweep_stats);
 -SCM_INTERNAL void scm_i_reset_segments (void);
 -SCM_INTERNAL void scm_i_sweep_all_segments (char const *reason,
 -                                          scm_t_sweep_statistics *sweep_stats);
 -SCM_INTERNAL SCM scm_i_all_segments_statistics (SCM hashtab);
 -SCM_INTERNAL unsigned long *scm_i_segment_table_info(int *size);
 -
 -SCM_INTERNAL long int scm_i_deprecated_memory_return;
 -SCM_INTERNAL long int scm_i_find_heap_calls;
 -SCM_INTERNAL long int scm_i_last_marked_cell_count;
  
  /*
    global init funcs.
Simple merge
@@@ -31,8 -32,9 +32,8 @@@
   */
  
  #define SCM_SUBR_META_INFO(x)  ((SCM *) SCM_CELL_WORD_3 (x))
- #define SCM_SNAME(x) (SCM_SUBR_META_INFO (x) [0])
+ #define SCM_SUBR_NAME(x) (SCM_SUBR_META_INFO (x) [0])
  #define SCM_SUBRF(x) ((SCM (*)()) SCM_CELL_WORD_1 (x))
 -#define SCM_SET_SUBRF(x, v) (SCM_SET_CELL_WORD_1 ((x), (v)))
  #define SCM_DSUBRF(x) ((double (*)()) SCM_CELL_WORD_1 (x))
  #define SCM_SUBR_PROPS(x) (SCM_SUBR_META_INFO (x) [1])
  #define SCM_SUBR_GENERIC(x) ((SCM *) SCM_CELL_WORD_2 (x))
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc libguile/root.h
Simple merge
Simple merge
diff --cc libguile/smob.c
Simple merge
diff --cc libguile/smob.h
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -135,6 -173,71 +172,49 @@@ scm_i_take_stringbufn (char *str, size_
                          (scm_t_bits) len, (scm_t_bits) 0);
  }
  
 -SCM
 -scm_i_stringbuf_mark (SCM buf)
 -{
 -  return SCM_BOOL_F;
 -}
 -
 -void
 -scm_i_stringbuf_free (SCM buf)
 -{
 -  if (!STRINGBUF_INLINE (buf))
 -    {
 -      if (!STRINGBUF_WIDE (buf))
 -        scm_gc_free (STRINGBUF_OUTLINE_CHARS (buf),
 -                     STRINGBUF_OUTLINE_LENGTH (buf) + 1, "string");
 -      else
 -        scm_gc_free (STRINGBUF_OUTLINE_CHARS (buf),
 -                     sizeof (scm_t_wchar) * (STRINGBUF_OUTLINE_LENGTH (buf) 
 -                                             + 1), "string");
 -    }
 -
 -}
 -
+ /* Convert a stringbuf containing 8-bit Latin-1-encoded characters to
+    one containing 32-bit UCS-4-encoded characters.  */
+ static void
+ widen_stringbuf (SCM buf)
+ {
+   size_t i, len;
+   scm_t_wchar *mem;
+   if (STRINGBUF_WIDE (buf))
+     return;
+   if (STRINGBUF_INLINE (buf))
+     {
+       len = STRINGBUF_INLINE_LENGTH (buf);
+       mem = scm_gc_malloc (sizeof (scm_t_wchar) * (len + 1), "string");
+       for (i = 0; i < len; i++)
+         mem[i] =
+           (scm_t_wchar) (unsigned char) STRINGBUF_INLINE_CHARS (buf)[i];
+       mem[len] = 0;
+       SCM_SET_CELL_WORD_0 (buf, SCM_CELL_WORD_0 (buf) ^ STRINGBUF_F_INLINE);
+       SCM_SET_CELL_WORD_0 (buf, SCM_CELL_WORD_0 (buf) | STRINGBUF_F_WIDE);
+       SCM_SET_CELL_WORD_1 (buf, mem);
+       SCM_SET_CELL_WORD_2 (buf, len);
+     }
+   else
+     {
+       len = STRINGBUF_OUTLINE_LENGTH (buf);
+       mem = scm_gc_malloc (sizeof (scm_t_wchar) * (len + 1), "string");
+       for (i = 0; i < len; i++)
+         mem[i] =
+           (scm_t_wchar) (unsigned char) STRINGBUF_OUTLINE_CHARS (buf)[i];
+       mem[len] = 0;
+       scm_gc_free (STRINGBUF_OUTLINE_CHARS (buf), len + 1, "string");
+       SCM_SET_CELL_WORD_0 (buf, SCM_CELL_WORD_0 (buf) | STRINGBUF_F_WIDE);
+       SCM_SET_CELL_WORD_1 (buf, mem);
+       SCM_SET_CELL_WORD_2 (buf, len);
+     }
+ }
  
  scm_i_pthread_mutex_t stringbuf_write_mutex = SCM_I_PTHREAD_MUTEX_INITIALIZER;
  
@@@ -331,20 -514,25 +478,32 @@@ scm_i_string_start_writing (SCM orig_st
  
        scm_i_pthread_mutex_unlock (&stringbuf_write_mutex);
  
-       new_buf = make_stringbuf (len);
-       memcpy (STRINGBUF_CHARS (new_buf),
-             STRINGBUF_CHARS (buf) + STRING_START (str), len);
+       if (scm_i_is_narrow_string (str))
+         {
+           new_buf = make_stringbuf (len);
+           memcpy (STRINGBUF_CHARS (new_buf),
+                   STRINGBUF_CHARS (buf) + STRING_START (str), len);
+         }
+       else
+         {
+           new_buf = make_wide_stringbuf (len);
+           u32_cpy ((scm_t_uint32 *) STRINGBUF_WIDE_CHARS (new_buf),
+                    (scm_t_uint32 *) (STRINGBUF_WIDE_CHARS (buf) 
+                                      + STRING_START (str)), len);
+         }
 -      scm_i_thread_put_to_sleep ();
 +
+       SET_STRING_STRINGBUF (str, new_buf);
        start -= STRING_START (str);
 +
 +      /* FIXME: The following operations are not atomic, so other threads
 +       looking at STR may see an inconsistent state.  Nevertheless it can't
 +       hurt much since (i) accessing STR while it is being mutated can't
 +       yield a crash, and (ii) concurrent accesses to STR should be
 +       protected by a mutex at the application level.  The latter may not
 +       apply when STR != ORIG_STR, though.  */
        SET_STRING_START (str, 0);
 -      scm_i_thread_wake_up ();
 +      SET_STRING_STRINGBUF (str, new_buf);
  
        buf = new_buf;
  
@@@ -445,10 -720,43 +691,31 @@@ scm_i_is_narrow_symbol (SCM sym
  const char *
  scm_i_symbol_chars (SCM sym)
  {
-   SCM buf = SYMBOL_STRINGBUF (sym);
-   return STRINGBUF_CHARS (buf);
+   SCM buf;
+   buf = SYMBOL_STRINGBUF (sym);
+   if (!STRINGBUF_WIDE (buf))
+     return STRINGBUF_CHARS (buf);
+   else
+     scm_misc_error (NULL, "Invalid access of chars of a wide symbol ~S",
+                     scm_list_1 (sym));
+ }
+ /* Return a pointer to the 32-bit UCS-4-encoded character array of a
+    symbol's name.  */
+ const scm_t_wchar *
+ scm_i_symbol_wide_chars (SCM sym)
+ {
+   SCM buf;
+   buf = SYMBOL_STRINGBUF (sym);
+   if (STRINGBUF_WIDE (buf))
+     return STRINGBUF_WIDE_CHARS (buf);
+   else
+     scm_misc_error (NULL, "Invalid access of chars of a narrow symbol ~S",
+                     scm_list_1 (sym));
  }
  
 -SCM
 -scm_i_symbol_mark (SCM sym)
 -{
 -  scm_gc_mark (SYMBOL_STRINGBUF (sym));
 -  return SCM_CELL_OBJECT_3 (sym);
 -}
 -
 -void
 -scm_i_symbol_free (SCM sym)
 -{
 -}
 -
  SCM
  scm_i_symbol_substring (SCM sym, size_t start, size_t end)
  {
@@@ -132,9 -164,21 +164,12 @@@ SCM_INTERNAL SC
  scm_i_c_take_symbol (char *name, size_t len,
                     scm_t_bits flags, unsigned long hash, SCM props);
  SCM_INTERNAL const char *scm_i_symbol_chars (SCM sym);
+ SCM_INTERNAL const scm_t_wchar *scm_i_symbol_wide_chars (SCM sym);
  SCM_INTERNAL size_t scm_i_symbol_length (SCM sym);
+ SCM_INTERNAL int scm_i_is_narrow_symbol (SCM str);
  SCM_INTERNAL SCM scm_i_symbol_substring (SCM sym, size_t start, size_t end);
+ SCM_INTERNAL scm_t_wchar scm_i_symbol_ref (SCM sym, size_t x);
  
 -/* internal GC functions. */
 -
 -SCM_INTERNAL SCM scm_i_string_mark (SCM str);
 -SCM_INTERNAL SCM scm_i_stringbuf_mark (SCM buf);
 -SCM_INTERNAL SCM scm_i_symbol_mark (SCM buf);
 -SCM_INTERNAL void scm_i_string_free (SCM str);
 -SCM_INTERNAL void scm_i_stringbuf_free (SCM buf);
 -SCM_INTERNAL void scm_i_symbol_free (SCM sym);
 -
  /* internal utility functions. */
  
  SCM_INTERNAL char **scm_i_allocate_string_pointers (SCM list);
@@@ -1,12 -1,12 +1,12 @@@
 -/* Copyright (C) 1996,1997,1998,1999,2000,2001, 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
 +/* Copyright (C) 1996,1997,1998,1999,2000,2001, 2003, 2004, 2006, 2007, 2008 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 as published by the Free Software Foundation; either
-  * version 2.1 of the License, or (at your option) any later version.
+  * modify it under the terms of the GNU Lesser General Public License
+  * as published by the Free Software Foundation; either version 3 of
+  * the License, or (at your option) any later version.
   *
-  * This library is distributed in the hope that it will be useful,
-  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * This library is distributed in the hope that it will be useful, but
+  * WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   * Lesser General Public License for more details.
   *
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc libguile/unif.c
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc libguile/vm.c
Simple merge
Simple merge
Simple merge
  
  
  # Specification in the form of a command-line invocation:
- #   gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl --libtool --macro-prefix=gl --no-vc-files alloca-opt autobuild extensions full-read full-write strcase strftime
 -#   gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl --libtool --macro-prefix=gl --no-vc-files alloca-opt autobuild byteswap canonicalize-lgpl count-one-bits environ extensions flock fpieee full-read full-write havelib iconv_open-utf lib-symbol-versions lib-symbol-visibility libunistring putenv stdlib strcase strftime striconveh string verify vsnprintf
++#   gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl --libtool --macro-prefix=gl --no-vc-files alloca-opt autobuild byteswap canonicalize-lgpl environ extensions flock fpieee full-read full-write havelib iconv_open-utf lib-symbol-versions lib-symbol-visibility libunistring putenv stdlib strcase strftime striconveh string verify vsnprintf
  
  # Specification in the form of a few gnulib-tool.m4 macro invocations:
  gl_LOCAL_DIR([])
  gl_MODULES([
    alloca-opt
    autobuild
 -  count-one-bits
+   byteswap
+   canonicalize-lgpl
+   environ
    extensions
+   flock
+   fpieee
    full-read
    full-write
+   havelib
+   iconv_open-utf
+   lib-symbol-versions
+   lib-symbol-visibility
+   libunistring
+   putenv
+   stdlib
    strcase
    strftime
+   striconveh
+   string
+   verify
+   vsnprintf
  ])
  gl_AVOID([])
  gl_SOURCE_BASE([lib])
@@@ -43,6 -45,26 +45,25 @@@ AC_DEFUN([gl_INIT]
    gl_COMMON
    gl_source_base='lib'
    gl_FUNC_ALLOCA
 -  gl_COUNT_ONE_BITS
+   gl_BYTESWAP
+   gl_CANONICALIZE_LGPL
+   gl_MODULE_INDICATOR([canonicalize-lgpl])
+   gl_ENVIRON
+   gl_UNISTD_MODULE_INDICATOR([environ])
+   gl_HEADER_ERRNO_H
+   gl_FLOAT_H
+   gl_FUNC_FLOCK
+   gl_HEADER_SYS_FILE_MODULE_INDICATOR([flock])
+   gl_FUNC_GETPAGESIZE
+   gl_UNISTD_MODULE_INDICATOR([getpagesize])
+   AM_ICONV
+   gl_ICONV_H
+   gl_FUNC_ICONV_OPEN
+   gl_FUNC_ICONV_OPEN_UTF
+   gl_INLINE
+   gl_LD_VERSION_SCRIPT
+   gl_VISIBILITY
+   gl_LIBUNISTRING
    gl_LOCALCHARSET
    LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(top_builddir)/$gl_source_base\""
    AC_SUBST([LOCALCHARSET_TESTS_ENVIRONMENT])
@@@ -193,9 -245,25 +244,24 @@@ AC_DEFUN([gltests_LIBSOURCES], 
  # This macro records the list of files which have been installed by
  # gnulib-tool and may be removed by future gnulib-tool invocations.
  AC_DEFUN([gl_FILE_LIST], [
+   build-aux/config.rpath
    build-aux/link-warning.h
    lib/alloca.in.h
+   lib/asnprintf.c
+   lib/byteswap.in.h
+   lib/c-ctype.c
+   lib/c-ctype.h
+   lib/c-strcase.h
+   lib/c-strcasecmp.c
+   lib/c-strcaseeq.h
+   lib/c-strncasecmp.c
+   lib/canonicalize-lgpl.c
+   lib/canonicalize.h
    lib/config.charset
 -  lib/count-one-bits.h
+   lib/errno.in.h
+   lib/float+.h
+   lib/float.in.h
+   lib/flock.c
    lib/full-read.c
    lib/full-read.h
    lib/full-write.c
    lib/time.in.h
    lib/time_r.c
    lib/unistd.in.h
+   lib/unistr.h
+   lib/unistr/u8-mbtouc-aux.c
+   lib/unistr/u8-mbtouc-unsafe-aux.c
+   lib/unistr/u8-mbtouc-unsafe.c
+   lib/unistr/u8-mbtouc.c
+   lib/unistr/u8-mbtoucr.c
+   lib/unistr/u8-prev.c
+   lib/unistr/u8-uctomb-aux.c
+   lib/unistr/u8-uctomb.c
+   lib/unitypes.h
+   lib/vasnprintf.c
+   lib/vasnprintf.h
    lib/verify.h
+   lib/vsnprintf.c
    lib/wchar.in.h
    lib/write.c
+   lib/xsize.h
+   m4/00gnulib.m4
    m4/alloca.m4
    m4/autobuild.m4
+   m4/byteswap.m4
+   m4/canonicalize-lgpl.m4
    m4/codeset.m4
 -  m4/count-one-bits.m4
+   m4/eealloc.m4
+   m4/environ.m4
+   m4/errno_h.m4
    m4/extensions.m4
+   m4/float_h.m4
+   m4/flock.m4
+   m4/fpieee.m4
+   m4/getpagesize.m4
    m4/glibc21.m4
    m4/gnulib-common.m4
+   m4/iconv.m4
+   m4/iconv_h.m4
+   m4/iconv_open.m4
    m4/include_next.m4
+   m4/inline.m4
+   m4/intmax_t.m4
+   m4/inttypes_h.m4
+   m4/ld-version-script.m4
+   m4/lib-ld.m4
+   m4/lib-link.m4
+   m4/lib-prefix.m4
+   m4/libunistring.m4
    m4/localcharset.m4
    m4/locale-fr.m4
    m4/locale-ja.m4
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -3,34 -3,23 +3,33 @@@
  ;;;;
  ;;;;  Copyright (C) 1999, 2001, 2006 Free Software Foundation, Inc.
  ;;;; 
- ;;;; This program is free software; you can redistribute it and/or modify
- ;;;; it under the terms of the GNU General Public License as published by
- ;;;; the Free Software Foundation; either version 2, or (at your option)
- ;;;; any later version.
+ ;;;; This library is free software; you can redistribute it and/or
+ ;;;; modify it under the terms of the GNU Lesser General Public
+ ;;;; License as published by the Free Software Foundation; either
+ ;;;; version 3 of the License, or (at your option) any later version.
  ;;;; 
- ;;;; This program is distributed in the hope that it will be useful,
+ ;;;; This library is distributed in the hope that it will be useful,
  ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
- ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- ;;;; GNU General Public License for more details.
+ ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ ;;;; Lesser General Public License for more details.
  ;;;; 
- ;;;; You should have received a copy of the GNU General Public License
- ;;;; along with this software; see the file COPYING.  If not, write to
- ;;;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- ;;;; Boston, MA 02110-1301 USA
+ ;;;; You should have received a copy of the GNU Lesser General Public
+ ;;;; License along with this library; if not, write to the Free Software
+ ;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  
  ;;; These tests make some questionable assumptions.
 +;;;
  ;;; - They assume that a GC will find all dead objects, so they
  ;;;   will become flaky if we have a generational GC.
 +;;;
 +;;; - More generally, when a weakly referenced object doesn't disappear as
 +;;;   expected, it's hard to tell whether that's because of a guardian bug of
 +;;;   because a reference to it is being held somewhere, e.g., one some part
 +;;;   of the stack that hasn't been overwritten.  Thus, most tests cannot
 +;;;   fail, they can just throw `unresolved'.  We try hard to clear
 +;;;   references that may have been left on the stacks (see "clear refs left
 +;;;   on the stack" lines).
 +;;;
  ;;; - They assume that objects won't be saved by the guardian until
  ;;;   they explicitly invoke GC --- in other words, they assume that GC
  ;;;   won't happen too often.