Changes from arch/CVS synchronization
[bpt/guile.git] / libguile / ChangeLog
index 58b3814..d59bc98 100644 (file)
@@ -1,3 +1,243 @@
+2007-10-27  Ludovic Courtès  <ludo@gnu.org>
+
+       * fports.c (scm_i_evict_port): Expect a port, rather than a pair
+       containing the port.  Fixes a bug in the new port table (2007-08-26).
+       (scm_evict_ports): Use `scm_c_port_for_each ()'.
+
+2007-10-21  Neil Jerram  <neil@ossau.uklinux.net>
+
+       * eval.c (unmemoize_delay): Extend the environment before
+       unmemoizing the promise thunk.  This fixes a segmentation fault
+       reported by Frank Schwidom.
+
+2007-10-20  Julian Graham  <joolean@gmail.com>
+
+       Add support for thread cancellation and user-defined thread
+       cleanup handlers.  Small rework by Ludovic Courtès.
+
+       * null-threads.h (scm_i_pthread_cancel,
+       scm_i_pthread_cleanup_push, scm_i_pthread_cleanup_pop): New.
+       * pthread-threads.h (scm_i_pthread_cancel,
+       scm_i_pthread_cleanup_push, scm_i_pthread_cleanup_pop): New.
+       * scmsigs.c (scm_i_signal_delivery_thread,
+       signal_delivery_thread_mutex): New.
+       (signal_delivery_thread): Leave when `read_without_guile ()'
+       returns zero.
+       (start_signal_delivery_thread): Acquire SIGNAL_DELIVERY_THREAD
+       before spawning the thread.  Initialize
+       SCM_I_SIGNAL_DELIVERY_THREAD.
+       (ensure_signal_delivery_thread): Renamed to...
+       (scm_i_ensure_signal_delivery_thread): this.
+       (scm_i_close_signal_pipe): New.
+       * scmsigs.h: Updated.
+       * threads.c (thread_mark): Mark `t->cleanup_handler'.
+       (guilify_self_1): Initialize `t->cleanup_handler' and
+       `t->canceled'.
+       (do_thread_exit): Invoke `t->cleanup_handler'.
+       (on_thread_exit): Call `scm_i_ensure_signal_delivery_thread ()'.
+       Call `scm_i_close_signal_pipe ()' when the next-to-last thread
+       vanishes.
+       (scm_leave_guile_cleanup): New.
+       (scm_i_with_guile_and_parent): Use `scm_i_pthread_cleanup_push ()' 
+       and `scm_leave_guile_cleanup ()' to leave guile mode, rather
+       than call `scm_leave_guile ()' after FUNC.
+       (scm_cancel_thread, scm_set_thread_cleanup_x,
+       scm_threads_cleanup): New.
+       (scm_all_threads): Remove SCM_I_SIGNAL_DELIVERY_THREAD from the
+       returned list.
+       * threads.h (scm_i_thread)[cleanup_handler, canceled]: New
+       fields.
+       Add declarations of new functions.
+       
+2007-10-17  Ludovic Courtès  <ludo@gnu.org>
+
+       * read.c (CHAR_IS_BLANK_): Add `\r' (ASCII 0x0d).  This fixes a
+       regression compared to 1.8.2.  Reported by Puneet
+       <schemer@gmail.com>.
+
+2007-10-10  Ludovic Courtès  <ludo@gnu.org>
+
+       * pthread-threads.h (SCM_I_PTHREAD_MUTEX_INITIALIZER): Check
+       `SCM_NEED_BRACES_ON_PTHREAD_MUTEX_INITIALIZER'.
+       * gen-scmconfig.h.in
+       (SCM_I_GSC_NEED_BRACES_ON_PTHREAD_MUTEX_INITIALIZER): New.
+       * gen-scmconfig.c (main): Define
+       `SCM_NEED_BRACES_ON_PTHREAD_MUTEX_INITIALIZER'.
+
+2007-10-04  Ludovic Courtès  <ludo@gnu.org>
+
+       * i18n.c (scm_make_locale)[!USE_GNU_LOCALE_API]: Don't call
+       `leave_locale_section ()' on failure of
+       `enter_locale_section ()' since the mutex is not held and locale
+       settings are unchanged.
+       (scm_nl_langinfo)[!USE_GNU_LOCALE_API]: Use
+       `restore_locale_settings ()' instead of `leave_locale_section ()' 
+       since the mutex is not held.
+       
+2007-10-02  Ludovic Courtès  <ludo@gnu.org>
+
+       * threads.c (on_thread_exit): Don't call `scm_leave_guile ()'
+       since we're already in non-guile mode.  Reported by Greg Toxel
+       for NetBSD.
+
+2007-10-01  Ludovic Courtès  <ludo@gnu.org>
+
+       * ports.c (flush_output_port): Expect directly a port instead of
+       a pair.  Fixes a bug in the new port table (2007-08-26).
+
+2007-09-11  Kevin Ryde  <user42@zip.com.au>
+
+       * posix.c (scm_putenv): Confine the putenv("NAME=") bit to mingw, use
+       putenv("NAME") as the fallback everywhere else.  In particular this is
+       needed for solaris 9.  Reported by Frank Storbeck.
+       
+2007-09-03  Ludovic Courtès  <ludo@gnu.org>
+
+       * read.c (flush_ws): Handle SCSH block comments.
+
+2007-09-03  Ludovic Courtès  <ludo@gnu.org>
+
+       Fix alignment issues which showed up at least on SPARC.
+
+       * socket.c (scm_t_max_sockaddr, scm_t_getsockopt_result): New.
+       (scm_inet_pton): Change DST to `scm_t_uint32' for correct
+       alignment.
+       (scm_getsockopt): Change OPTVAL to `scm_t_getsockopt_result' for
+       correct alignment.
+       (_scm_from_sockaddr): Change ADDRESS to `scm_t_max_sockaddr *'.
+       (scm_from_sockaddr): Cast ADDRESS to `scm_t_max_sockaddr *'.
+       (MAX_SIZE_UN, MAX_SIZE_IN6): Removed.
+       (scm_accept, scm_getsockname, scm_getpeername, scm_recvfrom):
+       Use `scm_t_max_sockaddr' instead of "char max_addr[MAX_ADDR_SIZE]".
+
+2007-09-03  Kevin Ryde  <user42@zip.com.au>
+
+       * numbers.c (scm_log): Test HAVE_CLOG as well as HAVE_COMPLEX_DOUBLE
+       before using clog().  It's possible for gcc to provide the "complex
+       double" type, but for the system not to have the complex funcs.
+       (scm_exp): Ditto HAVE_CEXP for cexp().
+       (clog, cexp, carg): Remove fallback definitions.  These only
+       duplicated the code within scm_log and scm_exp, and the latter have to
+       exist for the case when there's no "complex double".  So better just
+       fix up the conditionals selecting between the complex funcs and plain
+       doubles than worry about fallbacks.
+
+2007-09-02  Ludovic Courtès  <ludo@gnu.org>
+
+       * socket.c (scm_make_socket_address): Free C_ADDRESS after use.
+       This fixes a memory leak.
+
+2007-08-26  Han-Wen Nienhuys  <hanwen@lilypond.org>
+
+       * fports.c gc-card.c gc.c gc.h ioext.c ports.c ports.h weaks.h
+       gc.c: replace port table with weak hash table. This simplifies
+       memory management, and fixes freed cells appearing in
+       port-for-each output.
+
+       * init.c (cleanup_for_exit): abort cleanup if init_mutex is still
+       held.
+
+2007-08-23  Ludovic Courtès  <ludo@gnu.org>
+
+       * read.c (scm_read_quote): Record position and copy source
+       expression when asked to.  Reported by Kevin.
+
+       * stime.c: Define `_REENTRANT' only if not already defined.
+
+2007-08-21  Kevin Ryde  <user42@zip.com.au>
+
+       * gc-card.c (scm_i_card_statistics): Record scm_tc7_number types as
+       tc16 values so big, real, complex and fraction can be distinguished.
+
+       (scm_i_tag_name): Return "number" for scm_tc7_number, not NULL.  NULL
+       was making numbers come out as "type 23" in gc-live-object-stats.
+       Fix tests of the tc16 number types, they were checked under
+       scm_tc7_number, but the values went down the tag>=255 smob case.
+       Put smob case under scm_tc7_smob instead of using tag>=255, per
+       recommendation in comments with scm_tc7_smob to use symbolic values. 
+       Use SCM_TC2SMOBNUM to extract scm_smobs index, instead of explicit
+       code.  Lose some unnecessary "break" statements.
+
+       (scm_i_card_statistics): Use scm_hashq_create_handle_x and modify the
+       element returned, rather than two lookups scm_hashq_ref and
+       scm_hashq_set_x.
+
+2007-08-17  Kevin Ryde  <user42@zip.com.au>
+
+       * stime.c: Add #define _REENTRANT, to get gmtime_r() prototype on
+       solaris 2.6.  Reported by anirkko.
+
+2007-07-29  Ludovic Courtès  <ludo@gnu.org>
+
+       * Makefile.am (INCLUDES): Added Gnulib includes.
+       (gnulib_library): New.
+       (libguile_i18n_v_@LIBGUILE_I18N_MAJOR@_la_LIBADD): Added
+       `$(gnulib_library)'.
+       (libguile_la_LIBADD): Likewise.
+
+       * posix.c: Don't define `_GNU_SOURCE' since `gl_EARLY' arranges
+       to define it when available.
+       * srfi-14.c: Likewise.
+       * i18n.c: Likewise.  Include Gnulib's <alloca.h>
+       * eval.c: Include Gnulib's <alloca.h>.
+       * filesys.c: Likewise.
+       * read.c: Don't include <strings.h> and don't provide an
+       `strncasecmp ()' replacement; use Gnulib's <string.h> and
+       `strncasecmp ()' instead.
+
+2007-07-25  Ludovic Courtès  <ludo@gnu.org>
+
+       * eval.c (macroexp): When `scm_ilength (res) <= 0', return
+       immediately.  This used to produce a circular memoized
+       expression, e.g., for `(set (quote x) #t)'.
+
+2007-07-22  Ludovic Courtès  <ludo@gnu.org>
+
+       Overhauled the reader, making it faster.
+
+       * gdbint.c (tok_buf, tok_buf_mark_p): Removed.
+       (gdb_read): Don't use a token buffer.  Use `scm_read ()' instead
+       of `scm_lreadr ()'.
+
+       * read.c: Overhauled.  No longer use a token buffer.  Use a
+       on-stack C buffer in the common case and use Scheme strings when
+       larger buffers are needed.
+       * read.h (scm_grow_tok_buf, scm_flush_ws, scm_casei_streq,
+       scm_lreadr, scm_lreadrecparen): Removed.
+       (scm_i_input_error): Marked as `SCM_NORETURN'.
+
+2007-07-15  Ludovic Courtès  <ludo@gnu.org>
+
+       * script.c (scm_compile_shell_switches): Updated copyright year.
+
+2007-07-11  Ludovic Courtès  <ludo@gnu.org>
+
+       * goops.c (scm_sys_method_more_specific_p): Added docstring.
+       Make sure LEN is greater than or equal to the minimum length of
+       specializers of M1 and M2.  This fixes a segfault later on in
+       `more_specificp ()' if TARGS is too small.  Reported by Marco
+       Maggi <marco.maggi-ipsu@poste.it>.
+
+2007-06-26  Ludovic Courtès  <ludo@gnu.org>
+
+       * fluids.c (next_fluid_num): When growing ALLOCATED_FLUIDS, make
+       sure to free the previous array after the new one has been
+       installed.  This leak is made visible by running
+       "(define l (map (lambda (i) (make-fluid)) (iota 255)))"
+       from the REPL within Valgrind.
+
+2007-06-12  Ludovic Courtès  <ludo@chbouib.org>
+
+       * socket.c (scm_inet_ntop): In the `AF_INET' case, declare `addr4'
+       as an `scm_t_uint32' rather than re-using `addr6'.  This fixes a
+       bus error on SPARC (and possibly others) due to unaligned access.
+
+2007-06-07  Ludovic Courtès  <ludovic.courtes@laas.fr>
+
+       * posix.c (scm_ttyname): Check whether RESULT is NULL before
+       making a string from it (reported by Dan McMahill).  Don't call
+       `scm_from_locale_string ()' before the mutex is released.
+
 2007-05-26  Ludovic Courtès  <ludo@chbouib.org>
 
        * eval.c (scm_m_define): Updated comment.  Changed order for value