guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] GNU Guile branch, master, updated. release_1-9-3-43-g43b


From: Ludovic Courtès
Subject: [Guile-commits] GNU Guile branch, master, updated. release_1-9-3-43-g43b03fb
Date: Mon, 28 Sep 2009 21:44:37 +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=43b03fbbdc8d3eddc04daa1a14c5e2eae3ee5a1f

The branch, master has been updated
       via  43b03fbbdc8d3eddc04daa1a14c5e2eae3ee5a1f (commit)
       via  e0f651351140983ff6a14a4e9aa4a950a9f2d59d (commit)
       via  8cf0dd6104c58f68e0f0ecdf0ab28a033754acf1 (commit)
       via  3051344be566178999dd8679744e9c3ae9921de4 (commit)
      from  a16eda7a400bcfda52109ed839f4fb2e24fa72eb (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 43b03fbbdc8d3eddc04daa1a14c5e2eae3ee5a1f
Author: Ludovic Courtès <address@hidden>
Date:   Mon Sep 28 23:27:53 2009 +0200

    Make `weaks.test' slightly more robust.
    
    * test-suite/tests/weaks.test (global-weak): Use `string-copy' on all
      the keys, in case one of them is retained in `scm_source_whash' or
      similar.

commit e0f651351140983ff6a14a4e9aa4a950a9f2d59d
Author: Ludovic Courtès <address@hidden>
Date:   Mon Sep 28 23:21:47 2009 +0200

    Improve description of `scm_set_smob_mark ()'.
    
    * doc/ref/api-smobs.texi (Smobs): Improve description of
      `scm_set_smob_mark ()'.  Mention malloc(3) regions.

commit 8cf0dd6104c58f68e0f0ecdf0ab28a033754acf1
Author: Ludovic Courtès <address@hidden>
Date:   Fri Sep 25 13:45:16 2009 +0200

    Remove unneeded SMOB/port mark/free procedures.
    
    * libguile/arrays.c (array_mark, array_free): Remove.
      (scm_init_arrays): Adjust accordingly.
    
    * libguile/bitvectors.c (bitvector_free): Remove.
      (scm_c_make_bitvector): Use `scm_gc_malloc_pointerless ()'.
      (scm_init_bitvectors): Adjust accordingly.
    
    * libguile/strports.c (scm_make_stptob): Remove `scm_set_port_mark ()'
      call.
    
    * libguile/vports.c (scm_make_sfptob): Likewise.

commit 3051344be566178999dd8679744e9c3ae9921de4
Author: Ludovic Courtès <address@hidden>
Date:   Fri Sep 25 12:29:02 2009 +0200

    Remove default port/SMOB finalizers.
    
    * libguile/ports.c (scm_port_free0): Remove.
      (scm_make_port_type): Set `free' to NULL.
    
    * libguile/smob.c (scm_make_smob_type): Leave `free' to NULL.
      (scm_smob_free): Remove.
    
    * libguile/smob.h (scm_smob_free): Remove.
    
    * libguile/deprecated.c (scm_smob_free): New.
    
    * libguile/deprecated.h (scm_smob_free): New declaration.

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

Summary of changes:
 doc/ref/api-smobs.texi      |   17 +++++++++--------
 libguile/arrays.c           |   18 ------------------
 libguile/bitvectors.c       |   14 ++------------
 libguile/deprecated.c       |   15 +++++++++++++++
 libguile/deprecated.h       |    2 ++
 libguile/ports.c            |    8 +-------
 libguile/smob.c             |   18 +++---------------
 libguile/smob.h             |    1 -
 libguile/strports.c         |    1 -
 libguile/vports.c           |    3 +--
 test-suite/tests/weaks.test |   12 ++++++------
 11 files changed, 39 insertions(+), 70 deletions(-)

diff --git a/doc/ref/api-smobs.texi b/doc/ref/api-smobs.texi
index cc7f08b..82ca4b2 100644
--- a/doc/ref/api-smobs.texi
+++ b/doc/ref/api-smobs.texi
@@ -67,14 +67,15 @@ longer needed (@pxref{Memory Blocks, @code{scm_gc_malloc}}).
 This function sets the smob marking procedure for the smob type specified by
 the tag @var{tc}. @var{tc} is the tag returned by @code{scm_make_smob_type}.
 
-Defining a marking procedure should rarely be necessary because all the
-process' memory (with the exception of @code{scm_gc_malloc_pointerless}
-or read-only regions) is scanned for live address@hidden,
-in Guile up to the 1.8 series, the marking procedure was required.  The
-reason is that Guile's GC would only look for pointers in the memory
-area used for built-in types (the @dfn{cell heap}), not in
-user-allocated or statically allocated memory.  This approach is often
-referred to as @dfn{precise marking}.}.
+Defining a marking procedure may sometimes be unnecessary because large
+parts of the process' memory (with the exception of
address@hidden regions, and @code{malloc}- or
address@hidden memory) are scanned for live
address@hidden, in Guile up to the 1.8 series, the marking
+procedure was always required.  The reason is that Guile's GC would only
+look for pointers in the memory area used for built-in types (the
address@hidden heap}), not in user-allocated or statically allocated memory.
+This approach is often referred to as @dfn{precise marking}.}.
 
 The @var{mark} procedure must cause @code{scm_gc_mark} to be called
 for every @code{SCM} value that is directly referenced by the smob
diff --git a/libguile/arrays.c b/libguile/arrays.c
index 62ce83e..b9386ea 100644
--- a/libguile/arrays.c
+++ b/libguile/arrays.c
@@ -1095,22 +1095,6 @@ scm_i_read_array (SCM port, int c)
 
 
 static SCM
-array_mark (SCM ptr)
-{
-  return SCM_I_ARRAY_V (ptr);
-}
-
-static size_t
-array_free (SCM ptr)
-{
-  scm_gc_free (SCM_I_ARRAY_MEM (ptr),
-              (sizeof (scm_i_t_array) 
-               + SCM_I_ARRAY_NDIM (ptr) * sizeof (scm_t_array_dim)),
-              "array");
-  return 0;
-}
-
-static SCM
 array_handle_ref (scm_t_array_handle *h, size_t pos)
 {
   return scm_c_generalized_vector_ref (SCM_I_ARRAY_V (h->array), pos);
@@ -1146,8 +1130,6 @@ void
 scm_init_arrays ()
 {
   scm_i_tc16_array = scm_make_smob_type ("array", 0);
-  scm_set_smob_mark (scm_i_tc16_array, array_mark);
-  scm_set_smob_free (scm_i_tc16_array, array_free);
   scm_set_smob_print (scm_i_tc16_array, scm_i_print_array);
   scm_set_smob_equalp (scm_i_tc16_array, scm_array_equal_p);
 
diff --git a/libguile/bitvectors.c b/libguile/bitvectors.c
index f1d8473..c3b6f3e 100644
--- a/libguile/bitvectors.c
+++ b/libguile/bitvectors.c
@@ -45,15 +45,6 @@ static scm_t_bits scm_tc16_bitvector;
 #define BITVECTOR_BITS(obj)     ((scm_t_uint32 *)SCM_SMOB_DATA(obj))
 #define BITVECTOR_LENGTH(obj)   ((size_t)SCM_SMOB_DATA_2(obj))
 
-static size_t
-bitvector_free (SCM vec)
-{
-  scm_gc_free (BITVECTOR_BITS (vec),
-              sizeof (scm_t_uint32) * ((BITVECTOR_LENGTH (vec)+31)/32),
-              "bitvector");
-  return 0;
-}
-
 static int
 bitvector_print (SCM vec, SCM port, scm_print_state *pstate)
 {
@@ -120,8 +111,8 @@ scm_c_make_bitvector (size_t len, SCM fill)
   scm_t_uint32 *bits;
   SCM res;
 
-  bits = scm_gc_malloc (sizeof (scm_t_uint32) * word_len,
-                       "bitvector");
+  bits = scm_gc_malloc_pointerless (sizeof (scm_t_uint32) * word_len,
+                                   "bitvector");
   SCM_NEWSMOB2 (res, scm_tc16_bitvector, bits, len);
 
   if (!SCM_UNBNDP (fill))
@@ -896,7 +887,6 @@ void
 scm_init_bitvectors ()
 {
   scm_tc16_bitvector = scm_make_smob_type ("bitvector", 0);
-  scm_set_smob_free (scm_tc16_bitvector, bitvector_free);
   scm_set_smob_print (scm_tc16_bitvector, bitvector_print);
   scm_set_smob_equalp (scm_tc16_bitvector, bitvector_equalp);
 
diff --git a/libguile/deprecated.c b/libguile/deprecated.c
index d066996..1b9e581 100644
--- a/libguile/deprecated.c
+++ b/libguile/deprecated.c
@@ -633,6 +633,21 @@ scm_set_smob_mfpe (long tc,
   if (equalp) scm_set_smob_equalp (tc, equalp);
 }
 
+size_t
+scm_smob_free (SCM obj)
+{
+  long n = SCM_SMOBNUM (obj);
+
+  scm_c_issue_deprecation_warning
+    ("`scm_smob_free' is deprecated.  "
+     "It is no longer needed.");
+
+  if (scm_smobs[n].size > 0)
+    scm_gc_free ((void *) SCM_CELL_WORD_1 (obj), 
+                scm_smobs[n].size, SCM_SMOBNAME (n));
+  return 0;
+}
+
 SCM
 scm_read_0str (char *expr)
 {
diff --git a/libguile/deprecated.h b/libguile/deprecated.h
index f428f7d..18424d5 100644
--- a/libguile/deprecated.h
+++ b/libguile/deprecated.h
@@ -224,6 +224,8 @@ SCM_API void scm_set_smob_mfpe (long tc,
                                int (*print) (SCM, SCM, scm_print_state*),
                                SCM (*equalp) (SCM, SCM));
 
+SCM_API size_t scm_smob_free (SCM obj);
+
 SCM_API SCM scm_strprint_obj (SCM obj);
 SCM_API SCM scm_read_0str (char *expr);
 SCM_API SCM scm_eval_0str (const char *expr);
diff --git a/libguile/ports.c b/libguile/ports.c
index 24afbfe..53f64e3 100644
--- a/libguile/ports.c
+++ b/libguile/ports.c
@@ -127,12 +127,6 @@ end_input_default (SCM port SCM_UNUSED, int offset 
SCM_UNUSED)
 {
 }
 
-static size_t
-scm_port_free0 (SCM port)
-{
-  return 0;
-}
-
 scm_t_bits
 scm_make_port_type (char *name,
                    int (*fill_input) (SCM port),
@@ -153,7 +147,7 @@ scm_make_port_type (char *name,
 
       scm_ptobs[scm_numptob].name = name;
       scm_ptobs[scm_numptob].mark = 0;
-      scm_ptobs[scm_numptob].free = scm_port_free0;
+      scm_ptobs[scm_numptob].free = NULL;
       scm_ptobs[scm_numptob].print = scm_port_print;
       scm_ptobs[scm_numptob].equalp = 0;
       scm_ptobs[scm_numptob].close = 0;
diff --git a/libguile/smob.c b/libguile/smob.c
index 22b90ad..42a51fd 100644
--- a/libguile/smob.c
+++ b/libguile/smob.c
@@ -97,6 +97,7 @@ scm_markcdr (SCM ptr)
   return SCM_CELL_OBJECT_1 (ptr);
 }
 
+
 /* {Free}
  */
 
@@ -106,16 +107,7 @@ scm_free0 (SCM ptr SCM_UNUSED)
   return 0;
 }
 
-size_t
-scm_smob_free (SCM obj)
-{
-  long n = SCM_SMOBNUM (obj);
-  if (scm_smobs[n].size > 0)
-    scm_gc_free ((void *) SCM_CELL_WORD_1 (obj), 
-                scm_smobs[n].size, SCM_SMOBNAME (n));
-  return 0;
-}
-
+
 /* {Print}
  */
 
@@ -307,11 +299,7 @@ scm_make_smob_type (char const *name, size_t size)
     scm_misc_error (FUNC_NAME, "maximum number of smobs exceeded", SCM_EOL);
 
   scm_smobs[new_smob].name = name;
-  if (size != 0)
-    {
-      scm_smobs[new_smob].size = size;
-      scm_smobs[new_smob].free = scm_smob_free;
-    }
+  scm_smobs[new_smob].size = size;
 
   /* Make a class object if Goops is present. */
   if (SCM_UNPACK (scm_smob_class[0]) != 0)
diff --git a/libguile/smob.h b/libguile/smob.h
index ca4a418..ee0e53e 100644
--- a/libguile/smob.h
+++ b/libguile/smob.h
@@ -167,7 +167,6 @@ SCM_API void scm_i_finalize_smob (GC_PTR obj, GC_PTR data);
 SCM_API SCM scm_mark0 (SCM ptr);
 SCM_API SCM scm_markcdr (SCM ptr);
 SCM_API size_t scm_free0 (SCM ptr);
-SCM_API size_t scm_smob_free (SCM obj);
 SCM_API int scm_smob_print (SCM exp, SCM port, scm_print_state *pstate);
 
 /* The following set of functions is the standard way to create new
diff --git a/libguile/strports.c b/libguile/strports.c
index b984b83..95e93c9 100644
--- a/libguile/strports.c
+++ b/libguile/strports.c
@@ -573,7 +573,6 @@ scm_make_stptob ()
 {
   scm_t_bits tc = scm_make_port_type ("string", stfill_buffer, st_write);
 
-  scm_set_port_mark        (tc, scm_markstream);
   scm_set_port_end_input   (tc, st_end_input);
   scm_set_port_flush       (tc, st_flush);
   scm_set_port_seek        (tc, st_seek);
diff --git a/libguile/vports.c b/libguile/vports.c
index e3db60d..4fab2df 100644
--- a/libguile/vports.c
+++ b/libguile/vports.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995,1996,1998,1999,2000,2001, 2002, 2003, 2006 Free Software 
Foundation, Inc.
+/* Copyright (C) 1995,1996,1998,1999,2000,2001, 2002, 2003, 2006, 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
@@ -220,7 +220,6 @@ scm_make_sfptob ()
 {
   scm_t_bits tc = scm_make_port_type ("soft", sf_fill_input, sf_write);
 
-  scm_set_port_mark (tc, scm_markstream);
   scm_set_port_flush (tc, sf_flush);
   scm_set_port_close (tc, sf_close);
   scm_set_port_input_waiting (tc, sf_input_waiting);
diff --git a/test-suite/tests/weaks.test b/test-suite/tests/weaks.test
index b469887..b39d2e7 100644
--- a/test-suite/tests/weaks.test
+++ b/test-suite/tests/weaks.test
@@ -1,5 +1,5 @@
 ;;;; weaks.test --- tests guile's weaks     -*- scheme -*-
-;;;; Copyright (C) 1999, 2001, 2003, 2006 Free Software Foundation, Inc.
+;;;; Copyright (C) 1999, 2001, 2003, 2006, 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
@@ -95,11 +95,11 @@
 
 (define global-weak (make-weak-vector 10 #f))
 (begin
-  (vector-set! global-weak 0 "string")
-  (vector-set! global-weak 1 "beans")
-  (vector-set! global-weak 2 "to")
-  (vector-set! global-weak 3 "utah")
-  (vector-set! global-weak 4 "yum yum")
+  (vector-set! global-weak 0 (string-copy "string"))
+  (vector-set! global-weak 1 (string-copy "beans"))
+  (vector-set! global-weak 2 (string-copy "to"))
+  (vector-set! global-weak 3 (string-copy "utah"))
+  (vector-set! global-weak 4 (string-copy "yum yum"))
   (gc))
 
 ;;; Normal weak vectors


hooks/post-receive
-- 
GNU Guile




reply via email to

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