[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] GNU Guile branch, boehm-demers-weiser-gc, updated. relea
From: |
Ludovic Courtès |
Subject: |
[Guile-commits] GNU Guile branch, boehm-demers-weiser-gc, updated. release_1-9-2-281-gd7e7a02 |
Date: |
Wed, 02 Sep 2009 00:14:20 +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=d7e7a02a6251c8ed4f76933d9d30baeee3f599c0
The branch, boehm-demers-weiser-gc has been updated
via d7e7a02a6251c8ed4f76933d9d30baeee3f599c0 (commit)
from ba54a2026beaadb4e7566d4b9e2c9e4c7cd793e6 (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 -----------------------------------------------------------------
-----------------------------------------------------------------------
Summary of changes:
libguile/objcodes.c | 4 ++--
libguile/srfi-4.c | 9 +++++++++
libguile/srfi-4.i.c | 12 ++++++++++--
libguile/vm.c | 3 +--
4 files changed, 22 insertions(+), 6 deletions(-)
diff --git a/libguile/objcodes.c b/libguile/objcodes.c
index 33ba296..be34232 100644
--- a/libguile/objcodes.c
+++ b/libguile/objcodes.c
@@ -229,8 +229,8 @@ SCM_DEFINE (scm_objcode_to_bytecode, "objcode->bytecode",
1, 0, 0,
SCM_VALIDATE_OBJCODE (1, objcode);
len = sizeof(struct scm_objcode) + SCM_OBJCODE_TOTAL_LEN (objcode);
- /* FIXME: Is `gc_malloc' ok here? */
- u8vector = scm_gc_malloc (len, "objcode-u8vector");
+
+ u8vector = scm_malloc (len);
memcpy (u8vector, SCM_OBJCODE_DATA (objcode), len);
return scm_take_u8vector (u8vector, len);
diff --git a/libguile/srfi-4.c b/libguile/srfi-4.c
index de1130f..3024143 100644
--- a/libguile/srfi-4.c
+++ b/libguile/srfi-4.c
@@ -28,6 +28,7 @@
#include "libguile/_scm.h"
#include "libguile/__scm.h"
+#include "libguile/boehm-gc.h"
#include "libguile/srfi-4.h"
#include "libguile/bitvectors.h"
#include "libguile/bytevectors.h"
@@ -281,6 +282,14 @@ uvec_assert (int type, SCM obj)
scm_wrong_type_arg_msg (NULL, 0, obj, uvec_names[type]);
}
+/* Invoke free(3) on DATA, a user-provided buffer passed to one of the
+ `scm_take_' functions. */
+static void
+free_user_data (GC_PTR data, GC_PTR unused)
+{
+ free (data);
+}
+
static SCM
take_uvec (int type, void *base, size_t len)
{
diff --git a/libguile/srfi-4.i.c b/libguile/srfi-4.i.c
index cecd6c6..098752e 100644
--- a/libguile/srfi-4.i.c
+++ b/libguile/srfi-4.i.c
@@ -126,8 +126,16 @@ SCM_DEFINE (F(scm_list_to_,TAG,vector),
"list->"S(TAG)"vector", 1, 0, 0,
SCM
F(scm_take_,TAG,vector) (CTYPE *data, size_t n)
{
- scm_gc_register_collectable_memory ((void *)data, n*uvec_sizes[TYPE],
- uvec_names[TYPE]);
+ /* The manual says "Return a new uniform numeric vector [...] that uses the
+ memory pointed to by DATA". We *have* to use DATA as the underlying
+ storage; thus we must register a finalizer to eventually free(3) it. */
+ GC_finalization_proc prev_finalizer;
+ GC_PTR prev_finalization_data;
+
+ GC_REGISTER_FINALIZER_NO_ORDER (data, free_user_data, 0,
+ &prev_finalizer,
+ &prev_finalization_data);
+
return take_uvec (TYPE, data, n);
}
diff --git a/libguile/vm.c b/libguile/vm.c
index d215f4d..95aaa4f 100644
--- a/libguile/vm.c
+++ b/libguile/vm.c
@@ -190,8 +190,7 @@ really_make_boot_program (long nargs)
abort ();
text[1] = (scm_t_uint8)nargs;
- bp = scm_gc_malloc (sizeof (struct scm_objcode) + sizeof (text),
- "make-u8vector");
+ bp = scm_malloc (sizeof (struct scm_objcode) + sizeof (text));
memcpy (bp->base, text, sizeof (text));
bp->nargs = 0;
bp->nrest = 0;
hooks/post-receive
--
GNU Guile
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Guile-commits] GNU Guile branch, boehm-demers-weiser-gc, updated. release_1-9-2-281-gd7e7a02,
Ludovic Courtès <=