summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2011-05-26 17:03:23 +0200
committerAndy Wingo <wingo@pobox.com>2011-05-26 17:03:23 +0200
commitebc16e6a762748fc5939903a8b3a367d422f1371 (patch)
tree4941c8dc8a835ceeb7e05c5f981e82c8c8b4d2aa
parenta099c8d971c1d5b32e00f25469b36ce45fd4d8c7 (diff)
parenta8952d1fb73218ad2389bb290ebbb737d4f88fce (diff)
downloadguile-ebc16e6a762748fc5939903a8b3a367d422f1371.tar.gz
Merge remote-tracking branch 'local-2.0/stable-2.0'
-rw-r--r--doc/ref/data-rep.texi4
-rw-r--r--libguile/deprecated.c22
-rw-r--r--libguile/deprecated.h8
-rw-r--r--libguile/gc.c5
-rw-r--r--libguile/inline.h74
-rw-r--r--libguile/strings.c4
6 files changed, 34 insertions, 83 deletions
diff --git a/doc/ref/data-rep.texi b/doc/ref/data-rep.texi
index c16f1b1a6..d0a76e9be 100644
--- a/doc/ref/data-rep.texi
+++ b/doc/ref/data-rep.texi
@@ -443,8 +443,8 @@ representation, for obvious reasons.
@end deftypefn
@deftypefn Macro SCM SCM_UNSPECIFIED
-The value returned by expressions which the Scheme standard says return
-an ``unspecified'' value.
+The value returned by some (but not all) expressions that the Scheme
+standard says return an ``unspecified'' value.
This is sort of a weirdly literal way to take things, but the standard
read-eval-print loop prints nothing when the expression returns this
diff --git a/libguile/deprecated.c b/libguile/deprecated.c
index 3e2d88a7f..e6ef91757 100644
--- a/libguile/deprecated.c
+++ b/libguile/deprecated.c
@@ -56,6 +56,28 @@ scm_internal_dynamic_wind (scm_t_guard before,
+SCM
+scm_immutable_cell (scm_t_bits car, scm_t_bits cdr)
+{
+ scm_c_issue_deprecation_warning
+ ("scm_immutable_cell is deprecated. Use scm_cell instead.");
+
+ return scm_cell (car, cdr);
+}
+
+SCM
+scm_immutable_double_cell (scm_t_bits car, scm_t_bits cbr,
+ scm_t_bits ccr, scm_t_bits cdr)
+{
+ scm_c_issue_deprecation_warning
+ ("scm_immutable_double_cell is deprecated. Use scm_double_cell instead.");
+
+ return scm_double_cell (car, cbr, ccr, cdr);
+}
+
+
+
+
void
scm_i_init_deprecated ()
{
diff --git a/libguile/deprecated.h b/libguile/deprecated.h
index ca7f1418c..d11667191 100644
--- a/libguile/deprecated.h
+++ b/libguile/deprecated.h
@@ -137,6 +137,14 @@ typedef scm_i_t_array scm_i_t_array__GONE__REPLACE_WITH__scm_t_array;
+/* Deprecated 26-05-2011, as the GC_STUBBORN API doesn't do anything any
+ more. */
+SCM_API SCM scm_immutable_cell (scm_t_bits car, scm_t_bits cdr);
+SCM_API SCM scm_immutable_double_cell (scm_t_bits car, scm_t_bits cbr,
+ scm_t_bits ccr, scm_t_bits cdr);
+
+
+
void scm_i_init_deprecated (void);
#endif
diff --git a/libguile/gc.c b/libguile/gc.c
index 0451fbb42..3ae978fc0 100644
--- a/libguile/gc.c
+++ b/libguile/gc.c
@@ -224,11 +224,6 @@ SCM_SYMBOL (sym_protected_objects, "protected-objects");
SCM_SYMBOL (sym_times, "gc-times");
-/* Number of calls to SCM_NEWCELL since startup. */
-unsigned scm_newcell_count;
-unsigned scm_newcell2_count;
-
-
/* {Scheme Interface to GC}
*/
static SCM
diff --git a/libguile/inline.h b/libguile/inline.h
index 835edcc9a..a78cac515 100644
--- a/libguile/inline.h
+++ b/libguile/inline.h
@@ -83,14 +83,9 @@
SCM_API SCM scm_cell (scm_t_bits car, scm_t_bits cdr);
-SCM_API SCM scm_immutable_cell (scm_t_bits car, scm_t_bits cdr);
SCM_API SCM scm_double_cell (scm_t_bits car, scm_t_bits cbr,
scm_t_bits ccr, scm_t_bits cdr);
-SCM_API SCM scm_immutable_double_cell (scm_t_bits car, scm_t_bits cbr,
- scm_t_bits ccr, scm_t_bits cdr);
SCM_API SCM scm_words (scm_t_bits car, scm_t_uint16 n_words);
-/* no immutable words for now, would require initialization at the same time as
- allocation */
SCM_API SCM scm_array_handle_ref (scm_t_array_handle *h, ssize_t pos);
SCM_API void scm_array_handle_set (scm_t_array_handle *h, ssize_t pos, SCM val);
@@ -112,10 +107,6 @@ SCM_API void scm_puts (const char *str_data, SCM port);
introduce any extraneous symbols into the public namespace. We
only need SCM_C_INLINE to be seen publically . */
-extern unsigned scm_newcell2_count;
-extern unsigned scm_newcell_count;
-
-
#ifndef SCM_INLINE_C_INCLUDING_INLINE_H
SCM_C_EXTERN_INLINE
#endif
@@ -139,26 +130,6 @@ scm_cell (scm_t_bits car, scm_t_bits cdr)
SCM_C_EXTERN_INLINE
#endif
SCM
-scm_immutable_cell (scm_t_bits car, scm_t_bits cdr)
-{
- SCM cell = PTR2SCM (GC_MALLOC_STUBBORN (sizeof (scm_t_cell)));
-
- /* Initialize the type slot last so that the cell is ignored by the GC
- until it is completely initialized. This is only relevant when the GC
- can actually run during this code, which it can't since the GC only runs
- when all other threads are stopped. */
- SCM_GC_SET_CELL_WORD (cell, 1, cdr);
- SCM_GC_SET_CELL_WORD (cell, 0, car);
-
- GC_END_STUBBORN_CHANGE (SCM2PTR (cell));
-
- return cell;
-}
-
-#ifndef SCM_INLINE_C_INCLUDING_INLINE_H
-SCM_C_EXTERN_INLINE
-#endif
-SCM
scm_double_cell (scm_t_bits car, scm_t_bits cbr,
scm_t_bits ccr, scm_t_bits cdr)
{
@@ -202,51 +173,6 @@ scm_double_cell (scm_t_bits car, scm_t_bits cbr,
SCM_C_EXTERN_INLINE
#endif
SCM
-scm_immutable_double_cell (scm_t_bits car, scm_t_bits cbr,
- scm_t_bits ccr, scm_t_bits cdr)
-{
- SCM z;
-
- z = PTR2SCM (GC_MALLOC_STUBBORN (2 * sizeof (scm_t_cell)));
- /* Initialize the type slot last so that the cell is ignored by the
- GC until it is completely initialized. This is only relevant
- when the GC can actually run during this code, which it can't
- since the GC only runs when all other threads are stopped.
- */
- SCM_GC_SET_CELL_WORD (z, 1, cbr);
- SCM_GC_SET_CELL_WORD (z, 2, ccr);
- SCM_GC_SET_CELL_WORD (z, 3, cdr);
- SCM_GC_SET_CELL_WORD (z, 0, car);
-
- GC_END_STUBBORN_CHANGE (SCM2PTR (z));
-
- /* When this function is inlined, it's possible that the last
- SCM_GC_SET_CELL_WORD above will be adjacent to a following
- initialization of z. E.g., it occurred in scm_make_real. GCC
- from around version 3 (e.g., certainly 3.2) began taking
- advantage of strict C aliasing rules which say that it's OK to
- interchange the initialization above and the one below when the
- pointer types appear to differ sufficiently. We don't want that,
- of course. GCC allows this behaviour to be disabled with the
- -fno-strict-aliasing option, but would also need to be supplied
- by Guile users. Instead, the following statements prevent the
- reordering.
- */
-#ifdef __GNUC__
- __asm__ volatile ("" : : : "memory");
-#else
- /* portable version, just in case any other compiler does the same
- thing. */
- scm_remember_upto_here_1 (z);
-#endif
-
- return z;
-}
-
-#ifndef SCM_INLINE_C_INCLUDING_INLINE_H
-SCM_C_EXTERN_INLINE
-#endif
-SCM
scm_words (scm_t_bits car, scm_t_uint16 n_words)
{
SCM z;
diff --git a/libguile/strings.c b/libguile/strings.c
index 8e7ad8d82..e54c27d32 100644
--- a/libguile/strings.c
+++ b/libguile/strings.c
@@ -741,8 +741,8 @@ scm_i_c_make_symbol (const char *name, size_t len,
SCM buf = make_stringbuf (len);
memcpy (STRINGBUF_CHARS (buf), name, len);
- return scm_immutable_double_cell (scm_tc7_symbol | flags, SCM_UNPACK (buf),
- (scm_t_bits) hash, SCM_UNPACK (props));
+ return scm_double_cell (scm_tc7_symbol | flags, SCM_UNPACK (buf),
+ (scm_t_bits) hash, SCM_UNPACK (props));
}
/* Returns the number of characters in SYM. This may be different