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. v2.1.0-477-g553294d


From: Andy Wingo
Subject: [Guile-commits] GNU Guile branch, master, updated. v2.1.0-477-g553294d
Date: Thu, 28 Nov 2013 12:14:53 +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=553294d958c953f57658bad45affc15b55fcc471

The branch, master has been updated
       via  553294d958c953f57658bad45affc15b55fcc471 (commit)
       via  87fc4596e54d69559ce27868dd1a604ea322a6b1 (commit)
       via  35164d84e093ddf9e463fb72cc355c68a4ee92c9 (commit)
       via  5a706f034224869dfe4002c3f486c47e8a05c76d (commit)
       via  8d78304e4d2123ee1c6047dd6f4b5a2a0f41e19f (commit)
       via  064d24093b752999979b4a71d19f60489c5dfc6a (commit)
       via  a0a4d859c4101e41d669a62142a6ce1fb55d3a64 (commit)
       via  3cff108dde4a085ca12a57bcd0e245007bad339c (commit)
       via  f88e9510f06da3e304aa104df89a7d3f261e6034 (commit)
       via  c0d928dc2b50f8761b6c782e4dd34a6388d167fe (commit)
       via  a5d0c135c0bbff2fdcfb68cf8a7b4013f3b9aa58 (commit)
      from  f689dd6982697f592b0dd5e63dc87e516657fb25 (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 553294d958c953f57658bad45affc15b55fcc471
Author: Andy Wingo <address@hidden>
Date:   Thu Nov 28 12:10:50 2013 +0100

    Avoid needless GC on startup due to scm_gc_register_allocation
    
    * libguile/gc.c (bytes_until_gc): Initialize to
      DEFAULT_INITIAL_HEAP_SIZE, to avoid forced GC on the first
      mallocation.

commit 87fc4596e54d69559ce27868dd1a604ea322a6b1
Author: Andy Wingo <address@hidden>
Date:   Thu Nov 28 11:53:57 2013 +0100

    Remove private-gc.h
    
    * libguile/simpos.c (scm_getenv_int): Move here, from gc.c.
    
    * libguile/private-gc.h: Remove, unused.
    
    * libguile/simpos.h: Move scm_getenv_int declaration here.
    
    * libguile/vm.c:
    * libguile/gc.c: Adapt scm_getenv_int users.
    
    * libguile/gc-malloc.c:
    * libguile/load.c:
    * libguile/script.c: Remove private-gc includes from non-users of
      scm_getenv_int.
    
    * libguile/Makefile.am: Adapt.

commit 35164d84e093ddf9e463fb72cc355c68a4ee92c9
Author: Andy Wingo <address@hidden>
Date:   Thu Nov 28 11:46:13 2013 +0100

    scm_i_tag_name internal to gc.c
    
    * libguile/gc.c (scm_i_tag_name): Make internal to gc.c.
    
    * libguile/private-gc.h: Remove from here.

commit 5a706f034224869dfe4002c3f486c47e8a05c76d
Author: Andy Wingo <address@hidden>
Date:   Thu Nov 28 11:43:51 2013 +0100

    More private-gc excisions
    
    * libguile/private-gc.h (SCM_DOUBLECELL_ALIGNED_P): Remove; unused.
    * libguile/filesys.c (MAX, MIN): Move definitions here, from
      private-gc.h.
      (scm_sendfile, scm_readdir): Adapt uses of SCM_MAX and SCM_MIN to use
      MAX or MIN.

commit 8d78304e4d2123ee1c6047dd6f4b5a2a0f41e19f
Author: Andy Wingo <address@hidden>
Date:   Thu Nov 28 11:37:29 2013 +0100

    Remove unused enum policy_on_error
    
    * libguile/private-gc.h (enum policy_on_error): Remove unused enum.

commit 064d24093b752999979b4a71d19f60489c5dfc6a
Author: Andy Wingo <address@hidden>
Date:   Thu Nov 28 11:32:08 2013 +0100

    Tune initial heap size
    
    * libguile/fluids.c (new_fluid): Don't run an explicit GC for the first
      fluid.
    
    * libguile/gc.c (DEFAULT_INITIAL_HEAP_SIZE, scm_storage_prehistory):
      Enlarge from 32 kB to 512 or 1024 kB, depending on word size.  Reduces
      startup time by 10 or 15% by avoiding excessive
      GC.
    
    * libguile/private-gc.h: Remove SCM_DEFAULT_INIT_HEAP_SIZE_2 definition
      here.

commit a0a4d859c4101e41d669a62142a6ce1fb55d3a64
Author: Andy Wingo <address@hidden>
Date:   Thu Nov 28 11:05:38 2013 +0100

    Remove another GC 6.8 hack
    
    * libguile/gc.c (scm_storage_prehistory): Remove hack for BDW-GC 6.8.

commit 3cff108dde4a085ca12a57bcd0e245007bad339c
Author: Andy Wingo <address@hidden>
Date:   Thu Nov 28 10:59:42 2013 +0100

    Fix "include" doc typo
    
    * doc/ref/api-evaluation.texi (Local Inclusion): Fix typo.

commit f88e9510f06da3e304aa104df89a7d3f261e6034
Author: Andy Wingo <address@hidden>
Date:   Thu Nov 28 10:57:42 2013 +0100

    Use version 2.2 in manual examples
    
    * doc/ref/api-evaluation.texi (Load Paths):
    * doc/ref/api-options.texi (Build Config):
    * doc/ref/guile-invoke.texi (Environment Variables):
    * doc/ref/libguile-parallel.texi (Parallel Installations): Use 2.2 in
      examples, rather than 2.0.

commit c0d928dc2b50f8761b6c782e4dd34a6388d167fe
Author: Andy Wingo <address@hidden>
Date:   Thu Nov 28 10:56:55 2013 +0100

    Fix some references to objcode in the manual
    
    * doc/ref/api-evaluation.texi (Compilation): Update references from
      "objcode" to "rtl".

commit a5d0c135c0bbff2fdcfb68cf8a7b4013f3b9aa58
Author: Andy Wingo <address@hidden>
Date:   Wed Nov 27 22:30:15 2013 +0100

    Remove nonfunctional gdb interface
    
    * libguile/gdb_interface.h:
    * libguile/gdbint.c:
    * libguile/gdbint.h: Remove.  These were last modified significantly in
      1997 and I think they are unused.
    
    * libguile/guile.c: Remove use.
    * libguile.h: Remove inclusion.
    * libguile/Makefile.am: Remove reference.
    * libguile/init.c: Remove use.

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

Summary of changes:
 doc/ref/api-evaluation.texi    |   16 ++--
 doc/ref/api-options.texi       |   12 +-
 doc/ref/guile-invoke.texi      |    6 +-
 doc/ref/libguile-parallel.texi |   10 +-
 libguile.h                     |    3 +-
 libguile/Makefile.am           |    5 +-
 libguile/filesys.c             |   25 ++--
 libguile/fluids.c              |    2 +-
 libguile/gc-malloc.c           |    2 -
 libguile/gc.c                  |   41 ++-----
 libguile/gdb_interface.h       |  154 -----------------------
 libguile/gdbint.c              |  266 ----------------------------------------
 libguile/gdbint.h              |   40 ------
 libguile/guile.c               |    6 -
 libguile/init.c                |    2 -
 libguile/load.c                |    1 -
 libguile/private-gc.h          |   54 --------
 libguile/script.c              |    3 +-
 libguile/simpos.c              |   17 +++-
 libguile/simpos.h              |    3 +-
 libguile/vm.c                  |    3 +-
 21 files changed, 70 insertions(+), 601 deletions(-)
 delete mode 100644 libguile/gdb_interface.h
 delete mode 100644 libguile/gdbint.c
 delete mode 100644 libguile/gdbint.h
 delete mode 100644 libguile/private-gc.h

diff --git a/doc/ref/api-evaluation.texi b/doc/ref/api-evaluation.texi
index f0edd11..1810fe8 100644
--- a/doc/ref/api-evaluation.texi
+++ b/doc/ref/api-evaluation.texi
@@ -664,13 +664,13 @@ Use @var{lang} as the source language of @var{file}.  If 
this option is omitted,
 @item -t @var{lang}
 @itemx address@hidden
 Use @var{lang} as the target language of @var{file}.  If this option is 
omitted,
address@hidden is assumed.
address@hidden is assumed.
 
 @item -T @var{target}
 @itemx address@hidden
-Produce bytecode for @var{target} instead of @var{%host-type}
-(@pxref{Build Config, %host-type}).  Target must be a valid GNU triplet,
-such as @code{armv5tel-unknown-linux-gnueabi} (@pxref{Specifying Target
+Produce code for @var{target} instead of @var{%host-type} (@pxref{Build
+Config, %host-type}).  Target must be a valid GNU triplet, such as
address@hidden (@pxref{Specifying Target
 Triplets,,, autoconf, GNU Autoconf Manual}).
 
 @end table
@@ -695,7 +695,7 @@ the Virtual Machine}.
 @end deffn
 
 @deffn {Scheme Procedure} compile-file file [#:output-file=#f] @
-                          [#:from=(current-language)] [#:to='objcode] @
+                          [#:from=(current-language)] [#:to='rtl] @
                           [#:env=(default-environment from)] @
                           [#:opts='()] @
                           [#:canonicalization='relative]
@@ -924,8 +924,8 @@ When @code{primitive-load-path} searches the 
@code{%load-compiled-path}
 for a corresponding compiled file for a relative path it does so by
 appending @code{.go} to the relative path.  For example, searching for
 @code{ice-9/popen} could find
address@hidden/usr/lib/guile/2.0/ccache/ice-9/popen.go}, and use it instead of
address@hidden/usr/share/guile/2.0/ice-9/popen.scm}.
address@hidden/usr/lib/guile/2.2/ccache/ice-9/popen.go}, and use it instead of
address@hidden/usr/share/guile/2.2/ice-9/popen.scm}.
 
 If @code{primitive-load-path} does not find a corresponding @code{.go}
 file in the @code{%load-compiled-path}, or the @code{.go} file is out of
@@ -1167,7 +1167,7 @@ it contains, splicing them into the location of the 
@code{include},
 within a @code{begin}.
 
 If @var{file-name} is a relative path, it is searched for relative to
-the path that contains the file that the @code{include} for appears in.
+the path that contains the file that the @code{include} form appears in.
 @end deffn
 
 If you are a C programmer, if @code{load} in Scheme is like
diff --git a/doc/ref/api-options.texi b/doc/ref/api-options.texi
index 8fa4f98..b09ae89 100644
--- a/doc/ref/api-options.texi
+++ b/doc/ref/api-options.texi
@@ -60,14 +60,14 @@ The @code{effective-version} function returns the version 
name that
 should remain unchanged during a stable series.  Currently that means
 that it omits the micro version.  The effective version should be used
 for items like the versioned share directory name
-i.e.@: @file{/usr/share/guile/2.0/}
+i.e.@: @file{/usr/share/guile/2.2/}
 
 @lisp
-(version) @result{} "2.0.4"
-(effective-version) @result{} "2.0"
+(version) @result{} "2.2.0"
+(effective-version) @result{} "2.2"
 (major-version) @result{} "2"
-(minor-version) @result{} "0"
-(micro-version) @result{} "4"
+(minor-version) @result{} "2"
+(micro-version) @result{} "0"
 @end lisp
 @end deffn
 
@@ -87,7 +87,7 @@ party package) are installed.  On Unix-like systems this is 
usually
 @file{/usr/share/guile/@var{GUILE_EFFECTIVE_VERSION}};
 
 @noindent
-for example @file{/usr/local/share/guile/2.0}.
+for example @file{/usr/local/share/guile/2.2}.
 @end deffn
 
 @deffn {Scheme Procedure} %site-dir
diff --git a/doc/ref/guile-invoke.texi b/doc/ref/guile-invoke.texi
index 207c6f3..2929286 100644
--- a/doc/ref/guile-invoke.texi
+++ b/doc/ref/guile-invoke.texi
@@ -365,7 +365,7 @@ Here is an example using the Bash shell that adds the 
current directory,
 @example
 $ export GUILE_LOAD_COMPILED_PATH=".:../my-library"
 $ guile -c '(display %load-compiled-path) (newline)'
-(. ../my-library /usr/local/lib/guile/2.0/ccache)
+(. ../my-library /usr/local/lib/guile/2.2/ccache)
 @end example
 
 @item GUILE_LOAD_PATH
@@ -384,8 +384,8 @@ directory to @code{%load-path}, and adds the relative 
directory
 @example
 $ env GUILE_LOAD_PATH=".:...:../srfi" \
 guile -c '(display %load-path) (newline)'
-(. /usr/local/share/guile/2.0 \
-/usr/local/share/guile/site/2.0 \
+(. /usr/local/share/guile/2.2 \
+/usr/local/share/guile/site/2.2 \
 /usr/local/share/guile/site \
 /usr/local/share/guile \
 ../srfi)
diff --git a/doc/ref/libguile-parallel.texi b/doc/ref/libguile-parallel.texi
index 37a7139..a0e1ea9 100644
--- a/doc/ref/libguile-parallel.texi
+++ b/doc/ref/libguile-parallel.texi
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Guile Reference Manual.
address@hidden Copyright (C)  1996, 1997, 2000, 2001, 2002, 2003, 2004, 2005, 
2010, 2011
address@hidden Copyright (C)  1996, 1997, 2000, 2001, 2002, 2003, 2004, 2005, 
2010, 2011, 2013
 @c   Free Software Foundation, Inc.
 @c See the file guile.texi for copying conditions.
 
@@ -11,10 +11,10 @@
 @cindex effective version
 
 Guile provides strong API and ABI stability guarantees during stable
-series, so that if a user writes a program against Guile version 2.0.3,
-it will be compatible with some future version 2.0.7.  We say in this
-case that 2.0 is the @dfn{effective version}, composed of the major and
-minor versions, in this case 2 and 0.
+series, so that if a user writes a program against Guile version 2.2.3,
+it will be compatible with some future version 2.2.7.  We say in this
+case that 2.2 is the @dfn{effective version}, composed of the major and
+minor versions, in this case 2 and 2.
 
 Users may install multiple effective versions of Guile, with each
 version's headers, libraries, and Scheme files under their own
diff --git a/libguile.h b/libguile.h
index 9a97429..b067b28 100644
--- a/libguile.h
+++ b/libguile.h
@@ -1,7 +1,7 @@
 #ifndef SCM_LIBGUILE_H
 #define SCM_LIBGUILE_H
 
-/* Copyright (C) 1995,1996,1997,1998,2000,2001, 2002, 2003, 2004, 2006, 2008, 
2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+/* Copyright (C) 1995,1996,1997,1998,2000,2001, 2002, 2003, 2004, 2006, 2008, 
2009, 2010, 2011, 2012, 2013 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
@@ -54,7 +54,6 @@ extern "C" {
 #include "libguile/foreign.h"
 #include "libguile/fports.h"
 #include "libguile/gc.h"
-#include "libguile/gdbint.h"
 #include "libguile/generalized-arrays.h"
 #include "libguile/generalized-vectors.h"
 #include "libguile/goops.h"
diff --git a/libguile/Makefile.am b/libguile/Makefile.am
index 273e1b6..3f66d9d 100644
--- a/libguile/Makefile.am
+++ b/libguile/Makefile.am
@@ -151,7 +151,6 @@ address@hidden@_la_SOURCES =                                
\
        frames.c                                \
        gc-malloc.c                             \
        gc.c                                    \
-       gdbint.c                                \
        gettext.c                               \
        generalized-arrays.c                    \
        generalized-vectors.c                   \
@@ -470,7 +469,7 @@ noinst_HEADERS = conv-integer.i.c conv-uinteger.i.c         
\
                  srfi-14.i.c                                   \
                  quicksort.i.c                                  \
                  win32-uname.h                                 \
-                private-gc.h private-options.h ports-internal.h
+                private-options.h ports-internal.h
 
 # vm instructions
 noinst_HEADERS += vm-engine.c
@@ -559,8 +558,6 @@ modinclude_HEADERS =                                \
        fports.h                                \
        frames.h                                \
        gc.h                                    \
-       gdb_interface.h                         \
-       gdbint.h                                \
        gettext.h                               \
        generalized-arrays.h                    \
        generalized-vectors.h                   \
diff --git a/libguile/filesys.c b/libguile/filesys.c
index 1893c02..8597f90 100644
--- a/libguile/filesys.c
+++ b/libguile/filesys.c
@@ -44,7 +44,6 @@
 #include "libguile/smob.h"
 #include "libguile/feature.h"
 #include "libguile/fports.h"
-#include "libguile/private-gc.h"  /* for SCM_MAX */
 #include "libguile/strings.h"
 #include "libguile/vectors.h"
 #include "libguile/dynwind.h"
@@ -141,6 +140,10 @@
     eno = errno; scm_dynwind_end (); errno = eno;      \
   } while (0)
 
+
+#define MAX(A, B) ((A) > (B) ? (A) : (B))
+#define MIN(A, B) ((A) < (B) ? (A) : (B))
+
 
 
 #ifdef HAVE_POSIX
@@ -1192,7 +1195,7 @@ SCM_DEFINE (scm_sendfile, "sendfile", 3, 1, 0,
       {
        size_t asked, obtained, written;
 
-       asked = SCM_MIN (sizeof buf, left);
+       asked = MIN (sizeof buf, left);
        obtained = full_read (in_fd, buf, asked);
        if (obtained < asked)
           {
@@ -1743,11 +1746,11 @@ SCM_DEFINE (scm_readdir, "readdir", 1, 0, 0,
     SCM_MISC_ERROR ("Directory ~S is not open.", scm_list_1 (port));
 
 #if HAVE_READDIR_R
-  /* As noted in the glibc manual, on various systems (such as Solaris) the
-     d_name[] field is only 1 char and you're expected to size the dirent
-     buffer for readdir_r based on NAME_MAX.  The SCM_MAX expressions below
-     effectively give either sizeof(d_name) or NAME_MAX+1, whichever is
-     bigger.
+  /* As noted in the glibc manual, on various systems (such as Solaris)
+     the d_name[] field is only 1 char and you're expected to size the
+     dirent buffer for readdir_r based on NAME_MAX.  The MAX expressions
+     below effectively give either sizeof(d_name) or NAME_MAX+1,
+     whichever is bigger.
 
      On solaris 10 there's no NAME_MAX constant, it's necessary to use
      pathconf().  We prefer NAME_MAX though, since it should be a constant
@@ -1761,15 +1764,15 @@ SCM_DEFINE (scm_readdir, "readdir", 1, 0, 0,
     struct dirent_or_dirent64 de; /* just for sizeof */
     DIR    *ds = (DIR *) SCM_SMOB_DATA_1 (port);
 #ifdef NAME_MAX
-    char   buf [SCM_MAX (sizeof (de),
-                        sizeof (de) - sizeof (de.d_name) + NAME_MAX + 1)];
+    char   buf [MAX (sizeof (de),
+                     sizeof (de) - sizeof (de.d_name) + NAME_MAX + 1)];
 #else
     char   *buf;
     long   name_max = fpathconf (dirfd (ds), _PC_NAME_MAX);
     if (name_max == -1)
       SCM_SYSERROR;
-    buf = alloca (SCM_MAX (sizeof (de),
-                          sizeof (de) - sizeof (de.d_name) + name_max + 1));
+    buf = alloca (MAX (sizeof (de),
+                       sizeof (de) - sizeof (de.d_name) + name_max + 1));
 #endif
 
     errno = 0;
diff --git a/libguile/fluids.c b/libguile/fluids.c
index 22d825b..4e0684a 100644
--- a/libguile/fluids.c
+++ b/libguile/fluids.c
@@ -116,7 +116,7 @@ new_fluid (SCM init)
        if (allocated_fluids[n] == NULL)
          break;
 
-      if (trial == 0 && n >= allocated_fluids_len)
+      if (trial == 0 && n >= allocated_fluids_len && allocated_fluids_len)
        /* All fluid numbers are in use.  Run a GC and retry.  Explicitly
           running the GC is costly and bad-style.  We only do this because
           dynamic state fluid vectors would grow unreasonably if fluid numbers
diff --git a/libguile/gc-malloc.c b/libguile/gc-malloc.c
index 994f222..63e6705 100644
--- a/libguile/gc-malloc.c
+++ b/libguile/gc-malloc.c
@@ -52,8 +52,6 @@ extern unsigned long * 
__libc_ia64_register_backing_store_base;
 #include "libguile/deprecation.h"
 #include "libguile/gc.h"
 
-#include "libguile/private-gc.h"
-
 #ifdef GUILE_DEBUG_MALLOC
 #include "libguile/debug-malloc.h"
 #endif
diff --git a/libguile/gc.c b/libguile/gc.c
index 5a14fb7..d13d89b 100644
--- a/libguile/gc.c
+++ b/libguile/gc.c
@@ -46,12 +46,12 @@ extern unsigned long * 
__libc_ia64_register_backing_store_base;
 #include "libguile/async.h"
 #include "libguile/ports.h"
 #include "libguile/root.h"
+#include "libguile/simpos.h"
 #include "libguile/strings.h"
 #include "libguile/vectors.h"
 #include "libguile/hashtab.h"
 #include "libguile/tags.h"
 
-#include "libguile/private-gc.h"
 #include "libguile/validate.h"
 #include "libguile/deprecation.h"
 #include "libguile/gc.h"
@@ -70,6 +70,12 @@ extern unsigned long * 
__libc_ia64_register_backing_store_base;
 #include <unistd.h>
 #endif
 
+/* Size in bytes of the initial heap.  This should be about the size of
+   result of 'guile -c "(display (assq-ref (gc-stats)
+   'heap-total-allocated))"'.  */
+
+#define DEFAULT_INITIAL_HEAP_SIZE (128 * 1024 * SIZEOF_SCM_T_BITS)
+
 /* Set this to != 0 if every cell that is accessed shall be checked:
  */
 int scm_debug_cell_accesses_p = 0;
@@ -231,6 +237,7 @@ SCM_SYMBOL (sym_times, "gc-times");
 
 /* {Scheme Interface to GC}
  */
+static char const * scm_i_tag_name (scm_t_bits tag);
 static SCM
 tag_table_to_type_alist (void *closure, SCM key, SCM val, SCM acc)
 {
@@ -561,25 +568,6 @@ scm_gc_unregister_roots (SCM *b, unsigned long n)
 
 
 
-/*
-  MOVE THIS FUNCTION. IT DOES NOT HAVE ANYTHING TODO WITH GC.
- */
-
-/* Get an integer from an environment variable.  */
-int
-scm_getenv_int (const char *var, int def)
-{
-  char *end = 0;
-  char *val = getenv (var);
-  long res = def;
-  if (!val)
-    return def;
-  res = strtol (val, &end, 10);
-  if (end == val)
-    return def;
-  return res;
-}
-
 void
 scm_storage_prehistory ()
 {
@@ -593,14 +581,7 @@ scm_storage_prehistory ()
 
   GC_INIT ();
 
-#if (! ((defined GC_VERSION_MAJOR) && (GC_VERSION_MAJOR >= 7))) \
-    && (defined SCM_I_GSC_USE_PTHREAD_THREADS)
-  /* When using GC 6.8, this call is required to initialize thread-local
-     freelists (shouldn't be necessary with GC 7.0).  */
-  GC_init ();
-#endif
-
-  GC_expand_hp (SCM_DEFAULT_INIT_HEAP_SIZE_2);
+  GC_expand_hp (DEFAULT_INITIAL_HEAP_SIZE);
 
   /* We only need to register a displacement for those types for which the
      higher bits of the type tag are used to store a pointer (that is, a
@@ -762,7 +743,7 @@ get_image_size (void)
 }
 
 /* These are discussed later.  */
-static size_t bytes_until_gc;
+static size_t bytes_until_gc = DEFAULT_INITIAL_HEAP_SIZE;
 static scm_i_pthread_mutex_t bytes_until_gc_lock = 
SCM_I_PTHREAD_MUTEX_INITIALIZER;
 
 /* Make GC run more frequently when the process image size is growing,
@@ -907,7 +888,7 @@ scm_gc_register_allocation (size_t size)
 
 
 
-char const *
+static char const *
 scm_i_tag_name (scm_t_bits tag)
 {
   switch (tag & 0x7f) /* 7 bits */
diff --git a/libguile/gdb_interface.h b/libguile/gdb_interface.h
deleted file mode 100644
index 2278fc2..0000000
--- a/libguile/gdb_interface.h
+++ /dev/null
@@ -1,154 +0,0 @@
-/* classes: h_files */
-
-#ifndef GDB_INTERFACE_H
-#define GDB_INTERFACE_H
-/* Simple interpreter interface for GDB, the GNU debugger.
-   Copyright (C) 1996, 2000, 2001, 2006 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
- * 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
- * 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 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
-
-The author can be reached at address@hidden
-Mikael Djurfeldt, SANS/NADA KTH, 10044 STOCKHOLM, SWEDEN  */
-
-/* This is the header file for GDB's interpreter interface.  The
-   interpreter must supply definitions of all symbols declared in this
-   file.
-
-   Before including this file, you must #define GDB_TYPE to be the
-   data type used for communication with the interpreter. */
-
-/* The following macro can be used to anchor the symbols of the
-   interface in your main program.  This is necessary if the interface
-   is defined in a library, such as Guile. */
-
-#if !defined (__MINGW32__) && !defined (__CYGWIN__)
-#define GDB_INTERFACE \
-void *gdb_interface[] = { \
-  &gdb_options, \
-  &gdb_language, \
-  &gdb_result, \
-  &gdb_output, \
-  &gdb_output_length, \
-  (void *) gdb_maybe_valid_type_p, \
-  (void *) gdb_read, \
-  (void *) gdb_eval, \
-  (void *) gdb_print, \
-  (void *) gdb_binding \
-}
-#else /* __MINGW32__, __CYGWIN__  */
-/* Because the following functions are imported from a DLL (some kind of
-   shared library) these are NO static initializers. That is why you need to
-   define them and assign the functions and data items at run time. */
-#define GDB_INTERFACE \
-void *gdb_interface[] = \
-  { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL };
-#define GDB_INTERFACE_INIT \
-  do { \
-    gdb_interface[0] = &gdb_options; \
-    gdb_interface[1] = &gdb_language; \
-    gdb_interface[2] = &gdb_result; \
-    gdb_interface[3] = &gdb_output; \
-    gdb_interface[4] = &gdb_output_length; \
-    gdb_interface[5] = (void *) gdb_maybe_valid_type_p; \
-    gdb_interface[6] = (void *) gdb_read; \
-    gdb_interface[7] = (void *) gdb_eval; \
-    gdb_interface[8] = (void *) gdb_print; \
-    gdb_interface[9] = (void *) gdb_binding; \
-  } while (0);
-#endif /* __MINGW32__ */
-
-/* GDB_OPTIONS is a set of flags informing gdb what features are present
-   in the interface.  Currently only one option is supported: */
-
-/* GDB_HAVE_BINDINGS: Set this bit if your interpreter can create new
-   top level bindings on demand (through gdb_top_level_binding) */
-
-#define GDB_HAVE_BINDINGS 1
-
-SCM_API unsigned short gdb_options;
-
-/* GDB_LANGUAGE holds the name of the preferred language mode for this
-   interpreter.  For lisp interpreters, the suggested mode is "lisp/c". */
-
-SCM_API char *gdb_language;
-   
-/* GDB_RESULT is used for passing results from the interpreter to GDB */
-
-SCM_API GDB_TYPE gdb_result;
-
-/* The interpreter passes strings to GDB in GDB_OUTPUT and
-   GDB_OUTPUT_LENGTH.  GDB_OUTPUT should hold the pointer to the
-   string.  GDB_OUTPUT_LENGTH should hold its length.  The string
-   doesn't need to be terminated by '\0'. */
-
-SCM_API char *gdb_output;
-
-SCM_API int gdb_output_length;
-
-/* Return TRUE if the interpreter regards VALUE's type as valid.  A
-   lazy implementation is allowed to pass TRUE always.  FALSE should
-   only be returned when it is certain that VALUE is not valid.
-
-   In the "lisp/c" language mode, this is used to heuristically
-   discriminate lisp values from C values during printing. */
-
-SCM_API int gdb_maybe_valid_type_p (GDB_TYPE value);
-
-/* Parse expression in string STR.  Store result in GDB_RESULT, then
-   return 0 to indicate success.  On error, return -1 to indicate
-   failure.  An error string can be passed in GDB_OUTPUT and
-   GDB_OUTPUT_LENGTH.  Be careful to set GDB_OUTPUT_LENGTH to zero if
-   no message is passed.  Please note that the resulting value should
-   be protected against garbage collection. */
-
-SCM_API int gdb_read (char *str);
-
-/* Evaluate expression EXP.  Store result in GDB_RESULT, then return 0
-   to indicate success.  On error, return -1 to indicate failure.  Any
-   output (both on success and failure) can be passed in GDB_OUTPUT
-   and GDB_OUTPUT_LENGTH.  Be careful to set GDB_OUTPUT_LENGTH to zero
-   if no output is passed.  Please note that the resulting lisp object
-   should be protected against garbage collection. */
-
-SCM_API int gdb_eval (GDB_TYPE exp);
-
-/* Print VALUE.  Store output in GDB_OUTPUT and GDB_OUTPUT_LENGTH.
-   Return 0 to indicate success.  On error, return -1 to indicate
-   failure.  GDB will not look at GDB_OUTPUT or GDB_OUTPUT_LENGTH on
-   failure.  Note that this function should be robust against strange
-   values.  It could in fact be passed any kind of value. */
-
-SCM_API int gdb_print (GDB_TYPE value);
-
-/* Bind NAME to VALUE in interpreter.  (GDB has previously obtained
-   NAME by passing a string to gdb_read.)  Return 0 to indicate
-   success or -1 to indicate failure.  This feature is optional.  GDB
-   will only call this function if the GDB_HAVE_BINDINGS flag is set
-   in gdb_options.  Note that GDB may call this function many times
-   for the same name.
-
-   For scheme interpreters, this function should introduce top-level
-   bindings. */
-
-SCM_API int gdb_binding (GDB_TYPE name, GDB_TYPE value);
-
-#endif  /* GDB_INTERFACE_H */
-
-/*
-  Local Variables:
-  c-file-style: "gnu"
-  End:
-*/
diff --git a/libguile/gdbint.c b/libguile/gdbint.c
deleted file mode 100644
index 2df3c5c..0000000
--- a/libguile/gdbint.c
+++ /dev/null
@@ -1,266 +0,0 @@
-/* GDB interface for Guile
- * Copyright (C) 1996,1997,1999,2000,2001,2002,2004,2009,2011,2012
- * 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 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
- * 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 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
- */
-
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
-#include "libguile/_scm.h"
-
-#include <stdio.h>
-#include <string.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#include "libguile/strports.h"
-#include "libguile/read.h"
-#include "libguile/eval.h"
-#include "libguile/chars.h"
-#include "libguile/modules.h"
-#include "libguile/ports.h"
-#include "libguile/fluids.h"
-#include "libguile/strings.h"
-#include "libguile/init.h"
-
-#include "libguile/gdbint.h"
-
-/* {Support for debugging with gdb}
- *
- * TODO:
- *
- * 1. Redirect outputs
- * 2. Catch errors
- * 3. Prevent print from causing segmentation fault when given broken pairs
- */
-
-#define GDB_TYPE SCM
-
-#include "libguile/gdb_interface.h"
-
-
-
-/* Be carefull when this macro is true.
-   scm_gc_running_p is set during gc.
- */
-#define SCM_GC_P (scm_gc_running_p)
-
-/* Macros that encapsulate blocks of code which can be called by the
- * debugger.
- */
-#define SCM_BEGIN_FOREIGN_BLOCK \
-do { \
-  scm_print_carefully_p = 1; \
-} while (0)
-
-
-#define SCM_END_FOREIGN_BLOCK \
-do { \
-  scm_print_carefully_p = 0; \
-} while (0)
-
-
-#define RESET_STRING { gdb_output_length = 0; }
-
-#define SEND_STRING(str) \
-do { \
-  gdb_output = (char *) (str); \
-  gdb_output_length = strlen ((const char *) (str)); \
-} while (0)
-
-
-/* {Gdb interface}
- */
-
-unsigned short gdb_options = GDB_HAVE_BINDINGS;
-
-char *gdb_language = "lisp/c";
-
-SCM gdb_result;
-
-char *gdb_output;
-
-int gdb_output_length;
-
-int scm_print_carefully_p;
-
-static SCM gdb_input_port;
-static SCM gdb_output_port;
-
-
-int
-gdb_maybe_valid_type_p (SCM value)
-{
-  return SCM_IMP (value); /*  || scm_in_heap_p (value); */ /* FIXME: What to
-                                                             do? */
-}
-
-
-int
-gdb_read (char *str)
-{
-#if 0
-  SCM ans;
-  int status = 0;
-  RESET_STRING;
-  /* Need to be restrictive about what to read? */
-  if (1)  /* (SCM_GC_P) */ /* FIXME */
-    {
-      char *p;
-      for (p = str; *p != '\0'; ++p)
-       switch (*p)
-         {
-         case '(':
-         case '\'':
-         case '"':
-           SEND_STRING ("Can't read this kind of expressions during gc");
-           return -1;
-         case '#':
-           if (*++p == '\0')
-             goto premature;
-           if (*p == '\\')
-             {
-               if (*++p != '\0')
-                 continue;
-             premature:
-               SEND_STRING ("Premature end of lisp expression");
-               return -1;
-             }
-         default:
-           continue;
-         }
-    }
-  SCM_BEGIN_FOREIGN_BLOCK;
-  unmark_port (gdb_input_port);
-  scm_seek (gdb_input_port, SCM_INUM0, scm_from_int (SEEK_SET));
-  scm_puts_unlocked (str, gdb_input_port);
-  scm_truncate_file (gdb_input_port, SCM_UNDEFINED);
-  scm_seek (gdb_input_port, SCM_INUM0, scm_from_int (SEEK_SET));
-
-  /* Read one object */
-  ans = scm_read (gdb_input_port);
-  if (SCM_GC_P)
-    {
-      if (SCM_HEAP_OBJECT_P (ans))
-       {
-         SEND_STRING ("Non-immediate created during gc.  Memory may be 
trashed.");
-         status = -1;
-         goto exit;
-       }
-    }
-  gdb_result = ans;
-  /* Protect answer from future GC (FIXME: still needed with BDW-GC?) */
-  if (SCM_HEAP_OBJECT_P (ans))
-    scm_permanent_object (ans);
-exit:
-  remark_port (gdb_input_port);
-  SCM_END_FOREIGN_BLOCK;
-  return status;
-#else
-  abort ();
-#endif
-}
-
-
-int
-gdb_eval (SCM exp)
-{
-  RESET_STRING;
-  if (SCM_GC_P)
-    {
-      SEND_STRING ("Can't evaluate lisp expressions during gc");
-      return -1;
-    }
-  SCM_BEGIN_FOREIGN_BLOCK;
-  {
-    gdb_result = scm_permanent_object (scm_primitive_eval (exp));
-  }
-  SCM_END_FOREIGN_BLOCK;
-  return 0;
-}
-
-
-int
-gdb_print (SCM obj)
-{
-  if (!scm_initialized_p)
-    SEND_STRING ("*** Guile not initialized ***");
-  else
-    {
-      RESET_STRING;
-      SCM_BEGIN_FOREIGN_BLOCK;
-      /* Reset stream */
-      scm_seek (gdb_output_port, SCM_INUM0, scm_from_int (SEEK_SET));
-      scm_write (obj, gdb_output_port);
-      scm_truncate_file (gdb_output_port, SCM_UNDEFINED);
-      {
-       scm_t_port *pt = SCM_PTAB_ENTRY (gdb_output_port);
-
-       scm_flush_unlocked (gdb_output_port);
-       *(pt->write_buf + pt->read_buf_size) = 0;
-       SEND_STRING (pt->read_buf);
-      }
-      SCM_END_FOREIGN_BLOCK;
-    }
-  return 0;
-}
-
-
-int
-gdb_binding (SCM name, SCM value)
-{
-  RESET_STRING;
-  if (SCM_GC_P)
-    {
-      SEND_STRING ("Can't create new bindings during gc");
-      return -1;
-    }
-  SCM_BEGIN_FOREIGN_BLOCK;
-  {
-    scm_define (name, value);
-  }
-  SCM_END_FOREIGN_BLOCK;
-  return 0;
-}
-
-void
-scm_init_gdbint ()
-{
-  static char *s = "scm_init_gdb_interface";
-  SCM port;
-
-  scm_print_carefully_p = 0;
-
-  port = scm_mkstrport (SCM_INUM0, SCM_BOOL_F,
-                       SCM_OPN | SCM_WRTNG,
-                       s);
-  gdb_output_port = scm_permanent_object (port);
-
-  port = scm_mkstrport (SCM_INUM0, SCM_BOOL_F,
-                       SCM_OPN | SCM_RDNG | SCM_WRTNG,
-                       s);
-  gdb_input_port = scm_permanent_object (port);
-}
-
-/*
-  Local Variables:
-  c-file-style: "gnu"
-  End:
-*/
diff --git a/libguile/gdbint.h b/libguile/gdbint.h
deleted file mode 100644
index d7c6cf3..0000000
--- a/libguile/gdbint.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* classes: h_files */
-
-#ifndef SCM_GDBINT_H
-#define SCM_GDBINT_H
-
-/* Copyright (C) 1996,2000, 2006, 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 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
- * 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 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
- */
-
-
-
-#include "libguile/__scm.h"
-
-
-
-SCM_API int scm_print_carefully_p;
-
-SCM_INTERNAL void scm_init_gdbint (void);
-
-#endif  /* SCM_GDBINT_H */
-
-/*
-  Local Variables:
-  c-file-style: "gnu"
-  End:
-*/
diff --git a/libguile/guile.c b/libguile/guile.c
index 03b603e..f827d26 100644
--- a/libguile/guile.c
+++ b/libguile/guile.c
@@ -43,11 +43,6 @@
 #include <winsock2.h>
 #endif
 
-/* Debugger interface (don't change the order of the following lines) */
-#define GDB_TYPE SCM
-#include <libguile/gdb_interface.h>
-GDB_INTERFACE;
-
 static void
 inner_main (void *closure SCM_UNUSED, int argc, char **argv)
 {
@@ -55,7 +50,6 @@ inner_main (void *closure SCM_UNUSED, int argc, char **argv)
   /* This is necessary to startup the Winsock API under Win32. */
   WSADATA WSAData;
   WSAStartup (0x0202, &WSAData);
-  GDB_INTERFACE_INIT;
 #endif /* __MINGW32__ */
 
   /* module initializations would go here */
diff --git a/libguile/init.c b/libguile/init.c
index da6a857..54f73a9 100644
--- a/libguile/init.c
+++ b/libguile/init.c
@@ -64,7 +64,6 @@
 #include "libguile/fports.h"
 #include "libguile/frames.h"
 #include "libguile/gc.h"
-#include "libguile/gdbint.h"
 #include "libguile/generalized-arrays.h"
 #include "libguile/generalized-vectors.h"
 #include "libguile/goops.h"
@@ -438,7 +437,6 @@ scm_i_init_guile (void *base)
   scm_init_stime ();
   scm_init_gc ();              /* Requires hooks and `get_internal_run_time' */
   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 ();    /* Requires smob_prehistory */
diff --git a/libguile/load.c b/libguile/load.c
index ebf79a9..16e3fb2 100644
--- a/libguile/load.c
+++ b/libguile/load.c
@@ -28,7 +28,6 @@
 #include <stdio.h>
 
 #include "libguile/_scm.h"
-#include "libguile/private-gc.h" /* scm_getenv_int */
 #include "libguile/libpath.h"
 #include "libguile/fports.h"
 #include "libguile/read.h"
diff --git a/libguile/private-gc.h b/libguile/private-gc.h
deleted file mode 100644
index 4c691dd..0000000
--- a/libguile/private-gc.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * private-gc.h - private declarations for garbage collection.
- * 
- * Copyright (C) 2002, 03, 04, 05, 06, 07, 08, 09, 11 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 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
- * 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 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
- */
-
-#ifndef SCM_PRIVATE_GC
-#define SCM_PRIVATE_GC
-
-#include  "_scm.h"
-
-/* {heap tuning parameters}
- *
- * These are parameters for controlling memory allocation.  The heap
- * is the area out of which scm_cons, and object headers are allocated.
- *
- * Each heap cell is 8 bytes on a 32 bit machine and 16 bytes on a
- * 64 bit machine.  The units of the _SIZE parameters are bytes.
- * Cons pairs and object headers occupy one heap cell.
- */
-
-
-#define SCM_DEFAULT_INIT_HEAP_SIZE_2 32*1024
-
-#define SCM_DOUBLECELL_ALIGNED_P(x)  (((2 * sizeof (scm_t_cell) - 1) & 
SCM_UNPACK (x)) == 0)
-
-
-SCM_INTERNAL int scm_getenv_int (const char *var, int def);
-
-
-typedef enum { return_on_error, abort_on_error } policy_on_error;
-
-
-#define SCM_MAX(A, B) ((A) > (B) ? (A) : (B))
-#define SCM_MIN(A, B) ((A) < (B) ? (A) : (B))
-
-SCM_INTERNAL char const *scm_i_tag_name (scm_t_bits tag); /* MOVEME */
-
-#endif
diff --git a/libguile/script.c b/libguile/script.c
index 83daf8a..052ab8d 100644
--- a/libguile/script.c
+++ b/libguile/script.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-1998, 2000-2011 Free Software Foundation, Inc.
+/* Copyright (C) 1994-1998, 2000-2011, 2013 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 3 of
@@ -33,7 +33,6 @@
 #include "libguile/eval.h"
 #include "libguile/feature.h"
 #include "libguile/load.h"
-#include "libguile/private-gc.h" /* scm_getenv_int */
 #include "libguile/read.h"
 #include "libguile/script.h"
 #include "libguile/strings.h"
diff --git a/libguile/simpos.c b/libguile/simpos.c
index 8859d4f..7865da6 100644
--- a/libguile/simpos.c
+++ b/libguile/simpos.c
@@ -1,5 +1,5 @@
 /* Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001, 2003, 2004, 2009,
- *   2010, 2012 Free Software Foundation, Inc.
+ *   2010, 2012, 2013 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
@@ -190,6 +190,21 @@ SCM_DEFINE (scm_getenv, "getenv", 1, 0, 0,
 }
 #undef FUNC_NAME
 
+/* Get an integer from an environment variable.  */
+int
+scm_getenv_int (const char *var, int def)
+{
+  char *end = 0;
+  char *val = getenv (var);
+  long res = def;
+  if (!val)
+    return def;
+  res = strtol (val, &end, 10);
+  if (end == val)
+    return def;
+  return res;
+}
+
 /* simple exit, without unwinding the scheme stack or flushing ports.  */
 SCM_DEFINE (scm_primitive_exit, "primitive-exit", 0, 1, 0, 
             (SCM status),
diff --git a/libguile/simpos.h b/libguile/simpos.h
index b391a28..1e20768 100644
--- a/libguile/simpos.h
+++ b/libguile/simpos.h
@@ -3,7 +3,7 @@
 #ifndef SCM_SIMPOS_H
 #define SCM_SIMPOS_H
 
-/* Copyright (C) 1995,1996,1997,1998,2000, 2006, 2008 Free Software 
Foundation, Inc.
+/* Copyright (C) 1995,1996,1997,1998,2000, 2006, 2008, 2013 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
@@ -32,6 +32,7 @@ SCM_API SCM scm_system_star (SCM cmds);
 SCM_API SCM scm_getenv (SCM nam);
 SCM_API SCM scm_primitive_exit (SCM status);
 SCM_API SCM scm_primitive__exit (SCM status);
+SCM_INTERNAL int scm_getenv_int (const char *var, int def);
 SCM_INTERNAL void scm_init_simpos (void);
 
 #endif  /* SCM_SIMPOS_H */
diff --git a/libguile/vm.c b/libguile/vm.c
index f9441ad..5a69589 100644
--- a/libguile/vm.c
+++ b/libguile/vm.c
@@ -42,11 +42,10 @@
 #include "instructions.h"
 #include "loader.h"
 #include "programs.h"
+#include "simpos.h"
 #include "vm.h"
 #include "vm-builtins.h"
 
-#include "private-gc.h" /* scm_getenv_int */
-
 static int vm_default_engine = SCM_VM_REGULAR_ENGINE;
 
 /* Unfortunately we can't snarf these: snarfed things are only loaded up from


hooks/post-receive
-- 
GNU Guile



reply via email to

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