bpt/guile.git
15 years agoUse `GC_base ()' to determine whether a pointer points to the heap.
Ludovic Courtès [Sun, 1 Feb 2009 20:59:32 +0000 (21:59 +0100)]
Use `GC_base ()' to determine whether a pointer points to the heap.

* libguile/boehm-gc.h (SCM_I_IS_POINTER_TO_THE_HEAP): Use `GC_base ()'
  instead of `GC_{least,greatest}_plausible_heap addr' since the GC does
  not assume that the heap is contiguous (suggested by Ivan Maidanski
  and Hans Boehm).

15 years agoFix invalid writes to read-only stringbufs.
Ludovic Courtès [Sun, 1 Feb 2009 00:54:41 +0000 (01:54 +0100)]
Fix invalid writes to read-only stringbufs.

* libguile/strings.c (SET_STRINGBUF_SHARED): Don't modify BUF if it's
  already marked as shared since it might be a read-only stringbuf.
  This error can be caught when linking with GNU ld with "-z relro".

15 years agoAllow the static initialization of subrs.
Ludovic Courtès [Sat, 31 Jan 2009 20:52:30 +0000 (21:52 +0100)]
Allow the static initialization of subrs.

* libguile/Makefile.am (snarf-gsubr.h): New target.
  (BUILT_SOURCES, nodist_modinclude_HEADERS, MOSTLYCLEANFILES): Add
  `snarf-gsubr.h'.

* libguile/procs.h (SCM_SUBR_ARITY_TO_TYPE): New macro.

* libguile/snarf.h (SCM_DEFINE): Rename to...
  (SCM_DEFINE_GSUBR): this.
  (SCM_DEFINE_SUBR)[SCM_SUPPORT_STATIC_ALLOCATION]: New macro.
  (SCM_DEFINE_SUBR_reqX_optY_rstZ)[SCM_SUPPORT_STATIC_ALLOCATION]: New
  set of macros.
  (SCM_IMMUTABLE_SUBR): New macro.

15 years agoAllow several `SNARF_INIT ()' per CPP output line.
Ludovic Courtès [Sat, 31 Jan 2009 20:06:40 +0000 (21:06 +0100)]
Allow several `SNARF_INIT ()' per CPP output line.

* libguile/guile-snarf.in (modern_snarf): Allow several `SNARF_INIT ()'
  per line.  This makes it possible to write snarffing macros that
  contain several `SNARF_INIT ()' invocations.

15 years agoImprove CPP token pasting in <snarf.h>.
Ludovic Courtès [Sat, 31 Jan 2009 19:54:50 +0000 (20:54 +0100)]
Improve CPP token pasting in <snarf.h>.

* libguile/snarf.h (scm_i_paste, scm_i_paste3): New macros.
  (SCM_SYMBOL, SCM_GLOBAL_SYMBOL, SCM_IMMUTABLE_STRING): Use them.

15 years agoDon't register disappearing links for non-heap objects.
Ludovic Courtès [Sat, 31 Jan 2009 18:14:56 +0000 (19:14 +0100)]
Don't register disappearing links for non-heap objects.

* libguile/boehm-gc.h (SCM_I_IS_POINTER_TO_THE_HEAP,
  SCM_I_REGISTER_DISAPPEARING_LINK): New.

* libguile/vectors.c (scm_c_vector_set_x): Use
  `SCM_I_REGISTER_DISAPPEARING_LINK ()' instead of
  `GC_GENERAL_REGISTER_DISAPPEARING_LINK ()'.

* libguile/weaks.c (scm_weak_car_pair, scm_weak_cdr_pair,
  scm_doubly_weak_pair): Likewise.

15 years agoUse double-cells to store subrs.
Ludovic Courtès [Tue, 20 Jan 2009 23:24:44 +0000 (00:24 +0100)]
Use double-cells to store subrs.

* libguile/procs.c (scm_subr_table, scm_subr_table_size,
  scm_subr_table_room, subr_table_gc_hint, scm_init_subr_table): Remove.
  (scm_c_make_subr): Simply return a double-cell, with the procedure
  name and properties stored in a two-element array.

* libguile/init.c (scm_i_init_guile): Remove call to
  `scm_init_subr_table ()'.

* libguile/procs.h (SCM_SUBR_META_INFO): New macro.
  (SCM_SNAME, SCM_SUBR_PROPS): Use it.
  (SCM_SUBR_GENERIC, SCM_SET_SUBR_GENERIC, SCM_SET_SUBR_GENERIC_LOC):
  Update.
  (scm_t_subr_entry, SCM_SUBR_ENTRY, SCM_SUBRNUM, scm_subr_table,
  scm_init_subr_table): Remove.

15 years agoAdd `SCM_SET_SUBR_GENERIC ()' to replace `SCM_SUBR_GENERIC ()' as an lvalue.
Ludovic Courtès [Tue, 20 Jan 2009 22:29:09 +0000 (23:29 +0100)]
Add `SCM_SET_SUBR_GENERIC ()' to replace `SCM_SUBR_GENERIC ()' as an lvalue.

* libguile/goops.c (scm_c_extend_primitive_generic): Use
  `SCM_SET_SUBR_GENERIC ()' instead of using `SCM_SUBR_GENERIC ()' as an
  lvalue.

* libguile/procs.c (scm_c_make_subr_with_generic): Use `SCM_SET_SUBR_GENERIC_LOC ()'.

* libguile/procs.h (SCM_SET_SUBR_GENERIC, SCM_SET_SUBR_GENERIC_LOC): New macros.

15 years agoUse `SCM_SNAME ()' when requesting the name of a subr.
Ludovic Courtès [Tue, 20 Jan 2009 20:24:41 +0000 (21:24 +0100)]
Use `SCM_SNAME ()' when requesting the name of a subr.

* libguile/gsubr.c (create_gsubr, create_gsubr_with_generic):
  Use `SCM_SNAME ()' instead of `SCM_SUBR_ENTRY (subr).name'.

* libguile/procs.c (scm_c_define_subr_with_generic, scm_makcclo):
  Likewise.
  (scm_c_make_subr_with_generic): Same with `SCM_SUBR_GENERIC ()'.

15 years agoMerge branch 'boehm-demers-weiser-gc' into bdw-gc-static-alloc
Ludovic Courtès [Mon, 19 Jan 2009 21:31:38 +0000 (22:31 +0100)]
Merge branch 'boehm-demers-weiser-gc' into bdw-gc-static-alloc

15 years agoGOOPS: Statically allocate the PORT class array.
Ludovic Courtès [Sun, 18 Jan 2009 19:21:44 +0000 (20:21 +0100)]
GOOPS: Statically allocate the PORT class array.

* libguile/goops.c (scm_port_class): Statically allocate it.
  (create_port_classes): Don't use `scm_calloc ()'.

* libguile/goops.h (scm_port_class): Update declaration.

* libguile/ports.c (scm_make_port_type): When checking whether
  GOOPS is initialized, check whether the first element of
  SCM_PORT_CLASS is non-zero.

15 years agoPublish the maximum number of port types as `SCM_I_MAX_PORT_TYPE_COUNT'.
Ludovic Courtès [Sun, 18 Jan 2009 17:47:20 +0000 (18:47 +0100)]
Publish the maximum number of port types as `SCM_I_MAX_PORT_TYPE_COUNT'.

* libguile/goops.c (create_port_classes): Use
  `SCM_I_MAX_PORT_TYPE_COUNT' instead of a hard-wired 256.

* libguile/objects.h (SCM_OUT_PCLASS_INDEX, SCM_INOUT_PCLASS_INDEX):
  Likewise.

* libguile/ports.c (scm_make_port_type): Likewise.

* libguile/ports.h (SCM_I_MAX_PORT_TYPE_COUNT): New macro.

15 years agoGOOPS: Statically allocate the SMOB class array.
Ludovic Courtès [Sun, 18 Jan 2009 15:53:01 +0000 (16:53 +0100)]
GOOPS: Statically allocate the SMOB class array.

* libguile/goops.c (scm_smob_class): Statically allocate it.
  (create_smob_classes): Don't malloc(3) `scm_smob_class'.

* libguile/goops.h (scm_smob_class): Update declaration.

* libguile/smob.c (scm_make_smob_type, scm_set_smob_apply): When
  checking whether GOOPS is initialized, check whether the first element
  of SCM_SMOB_CLASS is non-zero.

15 years agoPublish the maximum number of SMOB types as `SCM_I_MAX_SMOB_TYPE_COUNT'.
Ludovic Courtès [Sun, 18 Jan 2009 15:42:17 +0000 (16:42 +0100)]
Publish the maximum number of SMOB types as `SCM_I_MAX_SMOB_TYPE_COUNT'.

* libguile/goops.c (create_smob_classes): Refer to
  `SCM_I_MAX_SMOB_TYPE_COUNT' rather than 255 (which is wrong) or 256.

* libguile/smob.c (MAX_SMOB_COUNT): Alias for `SCM_I_MAX_SMOB_TYPE_COUNT'.

* libguile/smob.h (SCM_I_MAX_SMOB_TYPE_COUNT): New macro.

15 years agoUse `scm_gc_malloc ()' when allocating GOOPS `t_extension' objects.
Ludovic Courtès [Sun, 18 Jan 2009 15:30:36 +0000 (16:30 +0100)]
Use `scm_gc_malloc ()' when allocating GOOPS `t_extension' objects.

* libguile/goops.c (extension_gc_hint): New.
  (scm_c_extend_primitive_generic): Use `scm_gc_malloc ()' instead of
  `scm_malloc ()'.
  (setup_extended_primitive_generics): Don't call `free(3)' when
  removing a `t_extension' object.

15 years agoUse `scm_gc_malloc ()' when allocating hook entries.
Ludovic Courtès [Sun, 18 Jan 2009 15:13:31 +0000 (16:13 +0100)]
Use `scm_gc_malloc ()' when allocating hook entries.

* libguile/hooks.c (hook_entry_gc_hint): New.
  (scm_c_hook_add): Use `scm_gc_malloc ()' instead of `scm_malloc ()'.
  (scm_c_hook_remove): Don't explicitly free(3) the entry, let the GC do
  its job.

15 years agoUse `scm_gc malloc_pointerless ()' in `scm_i allocate_string_pointers ()'.
Ludovic Courtès [Sun, 18 Jan 2009 14:33:37 +0000 (15:33 +0100)]
Use `scm_gc malloc_pointerless ()' in `scm_i allocate_string_pointers ()'.

* libguile/dynl.c (free_string_pointers): Remove.
  (scm_dynamic_args_call): Remove reference to `free_string_pointers ()'
  and remove dynwind.

* libguile/posix.c (free_string_pointers): Remove.
  (scm_execl, scm_execlp, scm_execle, scm_environ): Remove references
  to `free_string_pointers ()'.

* libguile/simpos.c (free_string_pointers): Remove.
  (scm_system_star): Remove reference to `free_string_pointers ()',
  remove enclosing dynwind.

* libguile/strings.c (scm_i_allocate_string_pointers): Use
  `scm_gc_malloc_pointerless ()' and `scm_gc_malloc ()'
  instead of `scm_malloc ()' and `scm_to_locale_string ()',
  so that the result is automatically GC'd when no longer
  referenced.  Remove unneeded dynwind.
  (scm_i_free_string_pointers): Remove.

* libguile/strings.h (scm_i_free_string_pointers): Remove declaration.

15 years agoUse `scm_gc_malloc ()' when allocating the allocated fluid vector.
Ludovic Courtès [Sun, 18 Jan 2009 12:01:16 +0000 (13:01 +0100)]
Use `scm_gc_malloc ()' when allocating the allocated fluid vector.

* libguile/fluids.c (next_fluid_num): Use `scm_gc_malloc ()'.  Don't
  explicitly free the previously allocated array.

15 years agoRemove useless cooperative multi-threading source files.
Ludovic Courtès [Sun, 18 Jan 2009 11:53:01 +0000 (12:53 +0100)]
Remove useless cooperative multi-threading source files.

15 years agoUse `scm_gc_malloc ()' and friends when allocating the subr table.
Ludovic Courtès [Sun, 18 Jan 2009 11:50:18 +0000 (12:50 +0100)]
Use `scm_gc_malloc ()' and friends when allocating the subr table.

* libguile/procs.c (subr_table_gc_hint): New.
  (scm_c_make_subr): Use `scm_gc_realloc ()' instead of `scm_realloc ()'.
  (scm_init_subr_table): Use `scm_gc_malloc ()' instead of `scm_malloc ()'.

15 years agoMake variables related to the subr table size private and unsigned.
Ludovic Courtès [Sun, 18 Jan 2009 11:44:15 +0000 (12:44 +0100)]
Make variables related to the subr table size private and unsigned.

* libguile/procs.c (scm_subr_table_size, scm_subr_table_room): Made
  `static' and `unsigned'.
  (scm_c_make_subr)[entry]: Made `unsigned'.

* libguile/procs.h (scm_subr_table_size, scm_subr_table_room): Remove
  declarations.

15 years agoDon't use `scm_immutable_cell ()' for subrs.
Ludovic Courtès [Sun, 18 Jan 2009 11:19:41 +0000 (12:19 +0100)]
Don't use `scm_immutable_cell ()' for subrs.

* libguile/procs.c (scm_c_make_subr): Use `scm_cell ()' instead of
  `scm_immutable_cell ()' since subr cells can be mutated, e.g., via
  `SCM_SUBR_GENERIC ()' as in `scm_c_extend_primitive_generic ()' (this
  doesn't make any difference in practice as of libgc 7.1, though).

15 years agoMerge branch 'master' into boehm-demers-weiser-gc
Ludovic Courtès [Sat, 17 Jan 2009 21:37:13 +0000 (22:37 +0100)]
Merge branch 'master' into boehm-demers-weiser-gc

Conflicts:
lib/Makefile.am
m4/gnulib-cache.m4
m4/gnulib-comp.m4

15 years agoInvoke gnulib-tool with --no-vc-files option, and
Neil Jerram [Thu, 15 Jan 2009 01:07:15 +0000 (01:07 +0000)]
Invoke gnulib-tool with --no-vc-files option, and

remove files that should not have been committed to the repository.

15 years agoRevert lib/.gitignore and m4/.gitignore to how they should be
Neil Jerram [Thu, 15 Jan 2009 00:56:53 +0000 (00:56 +0000)]
Revert lib/.gitignore and m4/.gitignore to how they should be

(before my confused Gnulib commits...)

15 years agoRevert unintended change to INSTALL made by commit 4a462e35440fdc3f10b0f88b3fb737fa76...
Neil Jerram [Thu, 15 Jan 2009 00:09:21 +0000 (00:09 +0000)]
Revert unintended change to INSTALL made by commit 4a462e35440fdc3f10b0f88b3fb737fa76ed146d

15 years agoAdd more missing Gnulib files
Neil Jerram [Thu, 15 Jan 2009 00:04:02 +0000 (00:04 +0000)]
Add more missing Gnulib files

15 years agoAdd more missing Gnulib files
Neil Jerram [Wed, 14 Jan 2009 21:05:15 +0000 (21:05 +0000)]
Add more missing Gnulib files

15 years agoAdd missing Gnulib file (m4/localcharset.m4)
Neil Jerram [Wed, 14 Jan 2009 20:50:51 +0000 (20:50 +0000)]
Add missing Gnulib file (m4/localcharset.m4)

15 years agoAdd support for static allocation of cells, strings and stringbufs.
Ludovic Courtès [Tue, 13 Jan 2009 23:05:23 +0000 (00:05 +0100)]
Add support for static allocation of cells, strings and stringbufs.

* libguile/__scm.h (SCM_ALIGNED): New macro.

* libguile/_scm.h: Include "libguile/strings.h", to make the
  string/stringbuf-related constants visible to snarffed code.

* libguile/snarf.h (SCM_SUPPORT_STATIC_ALLOCATION): New macro.
  (SCM_SYMBOL, SCM_GLOBAL_SYMBOL)[SCM_SUPPORT_STATIC_ALLOCATION]: New
  alternative versions of these macros with support for (almost) static
  allocation via the use of `string->symbol'.
  (SCM_IMMUTABLE_DOUBLE_CELL, SCM_IMMUTABLE_STRINGBUF,
  SCM_IMMUTABLE_STRING): New macros.

* libguile/tags.h (SCM)[SCM_DEBUG_TYPING_STRICTNESS==1]: Use a pointer
  type that is compatible with other pointer types, to avoid potential
  violation of strict aliasing rules.

15 years agoExpose some of the string/stringbuf internal flags and tags.
Ludovic Courtès [Tue, 13 Jan 2009 22:59:17 +0000 (23:59 +0100)]
Expose some of the string/stringbuf internal flags and tags.

* libguile/strings.h (scm_tc7_ro_string, SCM_I_STRINGBUF_F_SHARED,
  SCM_I_STRINGBUF_F_INLINE): New macros.

* libguile/strings.c (STRINGBUF_F_SHARED): Alias for
  `SCM_I_STRINGBUF_F_SHARED'.
  (STRINGBUF_F_INLINE): Alias for `SCM_I_STRINGBUF_F_INLINE'.
  (RO_STRING_TAG): Alias for `scm_tc7_ro_string'.

15 years agoFixlet for `run-benchmark.scm'.
Ludovic Courtès [Sun, 14 Dec 2008 20:07:09 +0000 (21:07 +0100)]
Fixlet for `run-benchmark.scm'.

* gc-benchmarks/run-benchmark.scm (%default-options): Default to the
  empty list for `input'.

15 years agogc-benchmarks: Adapt `gcold.scm' so that if conforms to the framework.
Ludovic Courtès [Tue, 11 Nov 2008 20:01:40 +0000 (21:01 +0100)]
gc-benchmarks: Adapt `gcold.scm' so that if conforms to the framework.

* gc-benchmarks/larceny/gcold.scm (main): Rename to `gcold-benchmark'.
  (GCOld): Fix the order of the predicate and run-maker.

15 years agogc-benchmarks: Add `gcold.scm', by Clinger, Hansen et al.
Ludovic Courtès [Tue, 11 Nov 2008 17:27:24 +0000 (18:27 +0100)]
gc-benchmarks: Add `gcold.scm', by Clinger, Hansen et al.

See http://www.ccs.neu.edu/home/will/Twobit/benchmarksAbout.html for
details.

15 years agogc-benchmarks: Add `run-benchmark.scm'.
Ludovic Courtès [Tue, 11 Nov 2008 17:20:15 +0000 (18:20 +0100)]
gc-benchmarks: Add `run-benchmark.scm'.

15 years agogc-profile: Show the result of `(version)'.
Ludovic Courtès [Tue, 11 Nov 2008 17:19:24 +0000 (18:19 +0100)]
gc-profile: Show the result of `(version)'.

* gc-benchmarks/gc-profile.scm (main): Show `(version)'.

15 years agogc-benchmarks: Allow the iteration count to be passed to `gc-profile.scm'.
Ludovic Courtès [Mon, 10 Nov 2008 21:49:29 +0000 (22:49 +0100)]
gc-benchmarks: Allow the iteration count to be passed to `gc-profile.scm'.

* gc-benchmarks/gc-profile.scm (*iteration-count*): New parameter.
  (run-benchmark): Moved from `twobit-compat.scm'.  Honor
  `*iteration-count*'.
  (%options): Add `--iterations'.
  (show-help): Document it.
  (main): Parameterize `*iteration-count*'.

15 years agoImport GC benchmarks from Larceny, by Hansen, Clinger, et al.
Ludovic Courtès [Mon, 10 Nov 2008 19:30:33 +0000 (20:30 +0100)]
Import GC benchmarks from Larceny, by Hansen, Clinger, et al.

These GPLv2+-licensed GC benchmarks are available from
http://www.ccs.neu.edu/home/will/GC/sourcecode.html .

15 years agogc-benchmarks: Add a Larceny/Twobit benchmark compatibility layer.
Ludovic Courtès [Fri, 7 Nov 2008 20:11:44 +0000 (21:11 +0100)]
gc-benchmarks: Add a Larceny/Twobit benchmark compatibility layer.

* gc-benchmarks/gc-profile.scm: Load "twobit-compat.scm".
  (save-directory-excursion, load-larceny-benchmark): New procedures.
  (%options): New variable.
  (show-help, parse-args): New procedures.
  (main): Use `parse-args' and `load-larceny-benchmark'.

15 years agoAdd GC benchmarks.
Ludovic Courtès [Sun, 12 Oct 2008 21:51:03 +0000 (23:51 +0200)]
Add GC benchmarks.

15 years agoMake sure that we have a real on-the-stack alloca()
Neil Jerram [Mon, 12 Jan 2009 21:48:17 +0000 (21:48 +0000)]
Make sure that we have a real on-the-stack alloca()

Because of how Guile saves and restores continuations (by copying the
stack), and how it uses alloca to create space for debug information
on the stack, we must have an alloca() that really does use the stack,
and not one that uses the heap.

To do this, we use the Gnulib "alloca-opt" module instead of "alloca".

This commit also updates the Gnulib sources from the current Gnulib
Git repository.

15 years agoNEWS entry for %fast-slot-ref/set! fix
Neil Jerram [Sun, 4 Jan 2009 22:45:54 +0000 (22:45 +0000)]
NEWS entry for %fast-slot-ref/set! fix

15 years agoFix implementation of %fast-slot-ref and %fast-slot-set!
Neil Jerram [Sun, 4 Jan 2009 21:32:23 +0000 (21:32 +0000)]
Fix implementation of %fast-slot-ref and %fast-slot-set!

* libguile/goops.c (scm_sys_fast_slot_ref, scm_sys_fast_slot_set_x):
  Correct incantation for getting the number of slots of the specified
  instance.

* libguile/goops.h (SCM_NUMBER_OF_SLOTS): Removed (because wrong).

* test-suite/standalone/test-fast-slot-ref.in: New standalone test.

* configure.in: Generate test-suite/standalone/test-fast-slot-ref.

* test-suite/standalone/Makefile.am (check_SCRIPTS): Add
  test-fast-slot-ref.

15 years agoUpdate autogen.sh
Neil Jerram [Sun, 14 Dec 2008 14:42:08 +0000 (14:42 +0000)]
Update autogen.sh

* autogen.sh: Don't call guile-readline/autogen.sh; not needed because
  autoreconf recurses itself.  Remove copies of config.guess and
  config.sub, which are now invalid because we don't have those files
  in the top level directory.  Remove mention of
  --enable-maintainer-mode, as we don't use AM_MAINTAINER_MODE any
  more.

15 years agoDelete redundant `config.{guess,sub}'.
Ludovic Courtès [Tue, 2 Dec 2008 19:51:12 +0000 (20:51 +0100)]
Delete redundant `config.{guess,sub}'.

15 years agoFix typo in SRFI-19.
Ludovic Courtès [Mon, 22 Dec 2008 15:24:04 +0000 (16:24 +0100)]
Fix typo in SRFI-19.

* srfi/srfi-19.scm (priv:string->date): Check for EOF on CH, not PORT.

15 years agoUpdate `INSTALL', from Automake 1.10.2.
Ludovic Courtès [Thu, 18 Dec 2008 21:43:57 +0000 (22:43 +0100)]
Update `INSTALL', from Automake 1.10.2.

15 years agoDon't use deprecated functions in `debug-malloc.c'.
Ludovic Courtès [Thu, 18 Dec 2008 21:38:06 +0000 (22:38 +0100)]
Don't use deprecated functions in `debug-malloc.c'.

* libguile/debug-malloc.c (scm_malloc_stats): Use
  `scm_from_locale_string ()'.  Patch by Linas Vepstas
  <linasvepstas@gmail.com>.

15 years agosrfi-19: Fix `string->date' weekday lookup.
Ludovic Courtès [Thu, 18 Dec 2008 21:34:23 +0000 (22:34 +0100)]
srfi-19: Fix `string->date' weekday lookup.

* srfi/srfi-19.scm (priv:locale-abbr-weekday->index): Use
  `locale-day-short' since it expects integers in the range 1-7, unlike
  `priv:locale-abbr-weekday'.
  (priv:locale-long-weekday->index): Likewise.

* test-suite/tests/srfi-19.test ("SRFI date/time
  library")["string->date works on Sunday"]: New test.

15 years agoFixlet for `run-benchmark.scm'.
Ludovic Courtès [Sun, 14 Dec 2008 20:07:09 +0000 (21:07 +0100)]
Fixlet for `run-benchmark.scm'.

* gc-benchmarks/run-benchmark.scm (%default-options): Default to the
  empty list for `input'.

15 years agoFix typo in makefile.
Ludovic Courtès [Sun, 14 Dec 2008 19:54:18 +0000 (20:54 +0100)]
Fix typo in makefile.

* libguile/Makefile.am (DOT_X_FILES): Substitute `gettext.x' to
  `gettext.c'.

15 years agoMerge branch 'master' into boehm-demers-weiser-gc
Ludovic Courtès [Sun, 14 Dec 2008 19:25:56 +0000 (20:25 +0100)]
Merge branch 'master' into boehm-demers-weiser-gc

Conflicts:
lib/Makefile.am
libguile/struct.c
libguile/threads.c
m4/gnulib-cache.m4
m4/gnulib-comp.m4

15 years agoRevert "(scm_shell_usage): Note need for subscription to bug-guile@gnu.org."
Neil Jerram [Wed, 10 Dec 2008 19:11:28 +0000 (19:11 +0000)]
Revert "(scm_shell_usage): Note need for subscription to bug-guile@gnu.org."

This reverts commit f3e3f530c28cfa5c7830c5d9b01de6fc388bc42a, which is
appropriate because subscription is not now required for someone to
send a message to bug-guile@gnu.org.

Conflicts:

15 years agoRevert "Note need for subscription to bug-guile@gnu.org."
Neil Jerram [Wed, 10 Dec 2008 19:07:14 +0000 (19:07 +0000)]
Revert "Note need for subscription to bug-guile@gnu.org."

This reverts commit cbea802b3763aa8cb43c88f7df272da3e41c32da, which is
appropriate because subscription is not now required for someone to
send a message to bug-guile@gnu.org.

Conflicts:

15 years agoRevert "(Reporting Bugs): Note need for subscription to"
Neil Jerram [Wed, 10 Dec 2008 19:02:50 +0000 (19:02 +0000)]
Revert "(Reporting Bugs): Note need for subscription to"

This reverts commit e563095988a1c64feb30307928bcc090828cdda9, which is
appropriate because subscription is not now required for someone to
send a message to bug-guile@gnu.org.

Conflicts:

15 years agoRevert "* README: Note need for subscription to bug-guile@gnu.org."
Neil Jerram [Wed, 10 Dec 2008 18:57:20 +0000 (18:57 +0000)]
Revert "* README: Note need for subscription to bug-guile@gnu.org."

This reverts commit 51d079ab0d23e4175d333ce22eb3e74aeae5913d, which is
appropriate because subscription is not now required for someone to
send a message to bug-guile@gnu.org.

15 years agoi18n: Add comment about standardization of the `locale_t' API.
Ludovic Courtès [Wed, 10 Dec 2008 10:05:50 +0000 (11:05 +0100)]
i18n: Add comment about standardization of the `locale_t' API.

* libguile/i18n.c: Add pointer to the POSIX 2008 standardization of the
  API.

15 years agoFix erroneous differences in `NEWS' compared to `branch_release-1-8'.
Ludovic Courtès [Wed, 10 Dec 2008 09:44:24 +0000 (10:44 +0100)]
Fix erroneous differences in `NEWS' compared to `branch_release-1-8'.

15 years agoconfigure: Check for <ltdl.h>.
Ludovic Courtès [Wed, 10 Dec 2008 09:06:46 +0000 (10:06 +0100)]
configure: Check for <ltdl.h>.

* configure.in: Check for <ltdl.h>, to clarify misconfigurations.

15 years agoconfigure: Don't substitute `DLPREOPEN'.
Ludovic Courtès [Wed, 10 Dec 2008 08:57:33 +0000 (09:57 +0100)]
configure: Don't substitute `DLPREOPEN'.

* configure.in: Don't substitute `DLPREOPEN' since it's no longer used
  (see commit 72db29f200c38fca64a8ccd0d679821eb25de5a9).

15 years agoRemove everything to do with GDS Breakpoints
Neil Jerram [Tue, 9 Dec 2008 23:56:51 +0000 (23:56 +0000)]
Remove everything to do with GDS Breakpoints

(which I now regard as an unsuccesful experiment)

This commit makes all affected files the same in master as they are in branch_release-1-8.

* doc/ref/api-debug.texi (Breakpoints): Removed.

* doc/ref/scheme-using.texi (GDS Introduction, GDS Getting Started,
  Displaying the Scheme Stack): Remove mentions of breakpoints.
  (Setting Specific Breakpoints, Setting GDS-managed Breakpoints,
  Setting and Managing Breakpoints, Listing and Deleting Breakpoints,
  Moving and Losing Breakpoints): Removed.

* emacs/gds-scheme.el (gds-bufferless-breakpoints,
  gds-bpdef:behaviour, gds-bpdef:type, gds-bpdef:file-name,
  gds-bpdef:proc-name, gds-bpdef:lc, gds-breakpoint-number,
  gds-breakpoint-buffers, gds-breakpoint-programming,
  gds-breakpoint-cache, gds-breakpoint-face,
  gds-breakpoints-file-name, gds-delete-lost-breakpoints,
  gds-bpdefs-cache, gds-read-breakpoints-file, gds-adopt-breakpoints,
  gds-adopt-breakpoint, gds-make-breakpoint-overlay,
  gds-send-breakpoint-to-client, gds-default-breakpoint-type,
  gds-set-breakpoint, gds-defun-name-region,
  gds-breakpoint-overlays-at, gds-write-breakpoints-file,
  gds-fold-breakpoints, gds-delete-breakpoints, gds-delete-breakpoint,
  gds-breakpoint-at-point, gds-union, gds-user-selected-breakpoint,
  gds-describe-breakpoints, gds-describe-breakpoint,
  gds-after-save-update-breakpoints, gds-breakpoint-map): Removed.
  (gds-nondebug-protocol): Removed handling for `breakpoint' and
  `get-breakpoints'.

* emacs/gds.el (gds-scheme-first-load): Removed.

* ice-9/debugging/Makefile.am (ice9_debugging_sources): Removed
  breakpoints.scm and load-hooks.scm.

* ice-9/debugging/breakpoints.scm: Removed.

* ice-9/debugging/load-hooks.scm: Removed.

* ice-9/gds-client.scm (handle-nondebug-protocol): Remove everything
  to do with breakpoints.
  (breakpoints, set-gds-breakpoints): Removed.
  (run-utility): Call `connect-to-gds' instead of `set-gds-breakpoints'.

15 years agoMention the end of `ChangeLog' files in `NEWS'.
Ludovic Courtès [Mon, 8 Dec 2008 20:34:08 +0000 (21:34 +0100)]
Mention the end of `ChangeLog' files in `NEWS'.

15 years agoMake `config.status' happier.
Ludovic Courtès [Mon, 8 Dec 2008 20:17:21 +0000 (21:17 +0100)]
Make `config.status' happier.

* guile-tools.in (datarootdir): New variable, needed since `pkgdatadir'
  may refer to `${datarootdir}'.

15 years agoAdd other missing Gnulib files.
Ludovic Courtès [Mon, 8 Dec 2008 07:06:34 +0000 (08:06 +0100)]
Add other missing Gnulib files.

15 years agoRemove useless references to Libtool's `dlpreopen' mechanism.
Ludovic Courtès [Sun, 7 Dec 2008 21:01:50 +0000 (22:01 +0100)]
Remove useless references to Libtool's `dlpreopen' mechanism.

* libguile/Makefile.am (guile_LDFLAGS): Remove `@DLPREOPEN@' since it
  has no effect.

* libguile/guile.c (main): Don't invoke `LTDL_SET_PRELOADED_SYMBOLS ()'
  since it had no effect given how we invoke `libtool'.  It also fixes
  compatibility issues when using libltdl 1.5 with a Libtool 2.2
  package.

15 years agoAdd missing Gnulib M4 files.
Ludovic Courtès [Sun, 7 Dec 2008 21:34:47 +0000 (22:34 +0100)]
Add missing Gnulib M4 files.

Reported by Neil Jerram.

15 years agoSeveral new hash table tests, written by Gregory Marton.
Neil Jerram [Sun, 7 Dec 2008 16:26:32 +0000 (16:26 +0000)]
Several new hash table tests, written by Gregory Marton.

* test-suite/tests/hash.test ("make-hash-table, hash-table?",
  "hash-set and hash-ref", "auto-resizing hashx", "hashx"): New tests.

* AUTHORS, THANKS: Add Gregory Marton as a contributor.

15 years agoFix sloppy bound checking in `string-{ref,set!}' with the empty string.
Ludovic Courtès [Tue, 2 Dec 2008 18:42:39 +0000 (19:42 +0100)]
Fix sloppy bound checking in `string-{ref,set!}' with the empty string.

* libguile/strings.c (scm_string_ref): Add proper range checking for the
  empty string.
  (scm_string_set_x): Likewise.
  Reported by Bill Schottstaedt <bil@ccrma.Stanford.EDU>.

* test-suite/tests/strings.test ("string-ref"): New test prefix.
  ("string-set!")["empty string", "empty string and non-zero index",
  "out of range", "negative index", "regular string"]: New tests.

* NEWS: Update.

15 years agoUpdate `NEWS'.
Ludovic Courtès [Tue, 2 Dec 2008 18:30:56 +0000 (19:30 +0100)]
Update `NEWS'.

15 years agoFix potential deadlock in `make-struct'.
Ludovic Courtès [Sun, 30 Nov 2008 19:26:56 +0000 (20:26 +0100)]
Fix potential deadlock in `make-struct'.

* libguile/struct.c (scm_make_struct): Remove critical section, as
  suggested by Linas Vepstas <linasvepstas@gmail.com>.  See
  http://lists.gnu.org/archive/html/bug-guile/2008-11/msg00036.html for
  a discussion.

15 years agoMake GNU Libtool 2.2.x happier.
Ludovic Courtès [Sun, 30 Nov 2008 18:37:29 +0000 (19:37 +0100)]
Make GNU Libtool 2.2.x happier.

* configure.in: Use `AC_CONFIG_MACRO_DIR([m4])'.  Reverts patch
  b01284227e180d223c97e1b9ba7e2cbd0ddded7e and makes `libtoolize' from
  Libtool 2 happier (removes a couple of warnings).

* Makefile.am (ACLOCAL_AMFLAGS): Remove `-I guile-config' since that
  directory only contains macros that we distribute, not macros that we
  use.

15 years agoCheck the return value of libc's functions to make `_FORTIFY_SOURCE=2' work.
Ludovic Courtès [Sun, 30 Nov 2008 17:43:41 +0000 (18:43 +0100)]
Check the return value of libc's functions to make `_FORTIFY_SOURCE=2' work.

This fixes bug #24009 reported by Martin Pitt.

* libguile/threads.c (guilify_self_1): Check the return value of
  pipe(2).
  (scm_std_select): Use `full_read ()' instead of `read ()' when reading
  from WAKEUP_FD.

* libguile/async.c (scm_i_queue_async_cell): Use `full_write ()' instead
  of write(2) when writing to SLEEP_FD.

* libguile/fports.c (fport_flush): Likewise.

* libguile/posix.c (getgroups): Use the return value of getgroups(2) as
  NGROUPS.
  (scm_nice): Get the return value of nice(2) to make glibc happy.

* libguile/scmsigs.c (take_signal): Use `full_write ()' instead of
  write(2).

15 years agoUse Gnulib's `full-write' and `full-read' modules.
Ludovic Courtès [Sun, 30 Nov 2008 16:48:06 +0000 (17:48 +0100)]
Use Gnulib's `full-write' and `full-read' modules.

15 years agoUpdate Gnulib files to commit d4b129b8e5f8a8d1198020fd6fc79310d305936c.
Ludovic Courtès [Sun, 30 Nov 2008 16:44:44 +0000 (17:44 +0100)]
Update Gnulib files to commit d4b129b8e5f8a8d1198020fd6fc79310d305936c.

15 years agoUse orthodox libtoology in `guile'.
Ludovic Courtès [Mon, 24 Nov 2008 21:04:44 +0000 (22:04 +0100)]
Use orthodox libtoology in `guile'.

* libguile/guile.c (main): Use `LTDL_SET_PRELOADED_SYMBOLS ()' instead
  of our own trick.

15 years agoRun the handler of SRFI-34's `with-exception-handler' in the right dyn. env.
Ludovic Courtès [Mon, 24 Nov 2008 08:40:00 +0000 (09:40 +0100)]
Run the handler of SRFI-34's `with-exception-handler' in the right dyn. env.

* srfi/srfi-34.scm (with-exception-handler): Use `with-throw-handler'
  instead of `lazy-catch'.

* test-suite/tests/srfi-34.test ("SRFI 34")["`with-exception-handler'
  invokes HANDLER in THUNK's dynamic env."]: New test.

* test-suite/tests/srfi-39.test: Use `(srfi srfi-34)'.
  ("SRFI-39")["SRFI-34"]: New test.

* NEWS: Update.

15 years agoFix comments in `test-scm-c-read.c'.
Ludovic Courtès [Mon, 24 Nov 2008 08:10:51 +0000 (09:10 +0100)]
Fix comments in `test-scm-c-read.c'.

* test-suite/standalone/test-scm-c-read.c (make_port): Fix comments.

15 years agoAdd C unit test for `scm_c_read ()' and the port API.
Ludovic Courtès [Sat, 22 Nov 2008 14:48:16 +0000 (15:48 +0100)]
Add C unit test for `scm_c_read ()' and the port API.

* test-suite/standalone/Makefile.am (check_PROGRAMS, TESTS): Add
  `test-scm-c-read'.
  (test_scm_c_read_SOURCES, test_scm_c_read_CFLAGS,
  test_scm_c_read_LDADD): New.

15 years agoMake scm_c_read use caller buffer only for unbuffered ports.
Neil Jerram [Sun, 23 Nov 2008 22:37:23 +0000 (22:37 +0000)]
Make scm_c_read use caller buffer only for unbuffered ports.

We recently modified scm_c_read so that it temporarily swaps the
caller's buffer with the port's normal read buffer, in order to
improve performance in the case where the port is unbuffered (which
actually means having a single-byte buffer) - but we implemented the
swap in the buffered case too.  The latter turns out to be a bad idea
- because it means that the C code of a custom port implementation
cannot rely on a port's buffer always being the same as when it was
first set up - and so this commit reverts that.  The buffer swapping
trick now applies to unbuffered ports only.

* libguile/ports.c (scm_c_read): Only do swapping of port and caller
  buffer for unbuffered ports.

15 years agoUpdate `THANKS'.
Ludovic Courtès [Thu, 13 Nov 2008 23:41:41 +0000 (00:41 +0100)]
Update `THANKS'.

15 years agoUpdate the thread stack base when `scm_with_guile' is invoked multiple times.
Ludovic Courtès [Thu, 13 Nov 2008 23:35:32 +0000 (00:35 +0100)]
Update the thread stack base when `scm_with_guile' is invoked multiple times.

* NEWS: Update.

* libguile/threads.c (scm_i_init_thread_for_guile): When the thread is
  already guilified, update `t->base' so that it corresponds to the new
  stack base.  Bug report and patch by Linas Vepstas <linasvepstas@gmail.com>.

* test-suite/standalone/Makefile.am (test_scm_with_guile_CFLAGS,
  test_scm_with_guile_LDADD): New.
  (check_PROGRAMS, TESTS): Add `test-scm-with-guile'.

15 years agoAugment `.gitignore'.
Ludovic Courtès [Thu, 13 Nov 2008 22:27:25 +0000 (23:27 +0100)]
Augment `.gitignore'.

15 years agoUpdate "guile(1)" man page.
Ludovic Courtès [Thu, 13 Nov 2008 22:24:32 +0000 (23:24 +0100)]
Update "guile(1)" man page.

* doc/guile.1: Remove reference to the version and date.  Mention R5RS,
  instead of R4RS.  Explicitly say that the full documentation is in
  Texinfo (as other GNU packages do).

15 years agoAdd "guile(1)" man page.
Ludovic Courtès [Thu, 13 Nov 2008 22:12:34 +0000 (23:12 +0100)]
Add "guile(1)" man page.

Robert Merkel's copyright assignment to the FSF had apparently been on
file for some time.

* NEWS: Update.

* doc/Makefile.am (dist_man1_MANS): New.

15 years agogc-benchmarks: Adapt `gcold.scm' so that if conforms to the framework.
Ludovic Courtès [Tue, 11 Nov 2008 20:01:40 +0000 (21:01 +0100)]
gc-benchmarks: Adapt `gcold.scm' so that if conforms to the framework.

* gc-benchmarks/larceny/gcold.scm (main): Rename to `gcold-benchmark'.
  (GCOld): Fix the order of the predicate and run-maker.

15 years agogc-benchmarks: Add `gcold.scm', by Clinger, Hansen et al.
Ludovic Courtès [Tue, 11 Nov 2008 17:27:24 +0000 (18:27 +0100)]
gc-benchmarks: Add `gcold.scm', by Clinger, Hansen et al.

See http://www.ccs.neu.edu/home/will/Twobit/benchmarksAbout.html for
details.

15 years agogc-benchmarks: Add `run-benchmark.scm'.
Ludovic Courtès [Tue, 11 Nov 2008 17:20:15 +0000 (18:20 +0100)]
gc-benchmarks: Add `run-benchmark.scm'.

15 years agogc-profile: Show the result of `(version)'.
Ludovic Courtès [Tue, 11 Nov 2008 17:19:24 +0000 (18:19 +0100)]
gc-profile: Show the result of `(version)'.

* gc-benchmarks/gc-profile.scm (main): Show `(version)'.

15 years agoHave `version' return `PACKAGE_VERSION'.
Ludovic Courtès [Mon, 10 Nov 2008 22:46:29 +0000 (23:46 +0100)]
Have `version' return `PACKAGE_VERSION'.

* libguile/version.c (scm_version): Return `PACKAGE_VERSION' instead of
  "MAJOR.MINOR.MICRO".

15 years agoChange `GUILE_VERSION' to `1.9.0-bdwgc'.
Ludovic Courtès [Mon, 10 Nov 2008 22:45:28 +0000 (23:45 +0100)]
Change `GUILE_VERSION' to `1.9.0-bdwgc'.

* GUILE-VERSION (GUILE_VERSION): Add `-bdwgc' prefix.

15 years agoUse `pkg-config' to detect BDW-GC at configure-time.
Ludovic Courtès [Sun, 9 Nov 2008 22:31:09 +0000 (23:31 +0100)]
Use `pkg-config' to detect BDW-GC at configure-time.

* configure.in: Use `PKG_CHECK_MODULES' to look for libgc.  This only
  works with GC 7.x+, which is what we want anyway.

15 years agogc-benchmarks: Allow the iteration count to be passed to `gc-profile.scm'.
Ludovic Courtès [Mon, 10 Nov 2008 21:49:29 +0000 (22:49 +0100)]
gc-benchmarks: Allow the iteration count to be passed to `gc-profile.scm'.

* gc-benchmarks/gc-profile.scm (*iteration-count*): New parameter.
  (run-benchmark): Moved from `twobit-compat.scm'.  Honor
  `*iteration-count*'.
  (%options): Add `--iterations'.
  (show-help): Document it.
  (main): Parameterize `*iteration-count*'.

15 years agoImport GC benchmarks from Larceny, by Hansen, Clinger, et al.
Ludovic Courtès [Mon, 10 Nov 2008 19:30:33 +0000 (20:30 +0100)]
Import GC benchmarks from Larceny, by Hansen, Clinger, et al.

These GPLv2+-licensed GC benchmarks are available from
http://www.ccs.neu.edu/home/will/GC/sourcecode.html .

15 years agogc-benchmarks: Add a Larceny/Twobit benchmark compatibility layer.
Ludovic Courtès [Fri, 7 Nov 2008 20:11:44 +0000 (21:11 +0100)]
gc-benchmarks: Add a Larceny/Twobit benchmark compatibility layer.

* gc-benchmarks/gc-profile.scm: Load "twobit-compat.scm".
  (save-directory-excursion, load-larceny-benchmark): New procedures.
  (%options): New variable.
  (show-help, parse-args): New procedures.
  (main): Use `parse-args' and `load-larceny-benchmark'.

15 years agoWork around unintentional retention of modules by the GC.
Ludovic Courtès [Wed, 5 Nov 2008 17:50:23 +0000 (18:50 +0100)]
Work around unintentional retention of modules by the GC.

This reverts par of "Document the failure of `gc.test' wrt. unused modules."
(commit 328efeb9a66dddcf78a24fad96d3db58e9c3375d.)

* ice-9/boot-9.scm (set-module-eval-closure!): Don't set the `module' property
  on CLOSURE.

* libguile/modules.c (scm_lookup_closure_module): Call `abort ()' to make it
  clear that code that uses the `module' property no longer works.  That code
  is unused anyway.

15 years agoMerge branch 'master' into boehm-demers-weiser-gc
Ludovic Courtès [Tue, 4 Nov 2008 18:07:07 +0000 (19:07 +0100)]
Merge branch 'master' into boehm-demers-weiser-gc

Conflicts:
libguile/threads.c

15 years agoRemove the SMOB mark procedure for source properties.
Ludovic Courtès [Sun, 2 Nov 2008 22:24:10 +0000 (23:24 +0100)]
Remove the SMOB mark procedure for source properties.

* libguile/srcprop.c (srcprops_mark): Remove.
  (scm_init_srcprop): Remove call to `scm_set_smob_mark ()'.

15 years agoFix initialization of the SMOB GC "kind".
Ludovic Courtès [Fri, 31 Oct 2008 20:55:55 +0000 (21:55 +0100)]
Fix initialization of the SMOB GC "kind".

* libguile/smob.c (scm_smob_prehistory): When initializing
  SMOB_GC_KIND, pass 1 as the CLEAR_NEW_OBJECTS argument to
  `GC_new_kind ()'.  Without this, an assertion failure is
  triggered in libgc's `reclaim.c'.

15 years agoDon't invoke `on_thread_exit ()' from a pthread key destructor.
Ludovic Courtès [Thu, 30 Oct 2008 23:27:20 +0000 (00:27 +0100)]
Don't invoke `on_thread_exit ()' from a pthread key destructor.

The `on_thread_exit ()' function allocates memory via libgc.  When
called from the context of a pthread key detructor, the thread is
essentially "dead" already and `GC_lookup_thread ()' returns NULL,
which triggers an assertion in libgc's `thread_local_alloc.c'.  This
patch arranges so that `on_thread_exit ()' is called from a suitable
context.

* libguile/threads.c (on_thread_exit): Remove now invalid comment
  about access to libgc's TLS.
  (init_thread_key): Don't pass `on_thread_exit ()' to
  `scm_i_pthread_key_create ()'.
  (scm_leave_guile_cleanup): Invoke `do_thread_exit ()'.
  (really_launch): Invoke `pthread_exit ()'.

15 years agoDocument the impossibility to call the GC from within `on_thread_exit ()'.
Ludovic Courtès [Tue, 28 Oct 2008 08:52:51 +0000 (09:52 +0100)]
Document the impossibility to call the GC from within `on_thread_exit ()'.

* libguile/threads.c (on_thread_exit): Add `FIXME' comment.