diff options
author | Ludovic Courtes <ludovic.courtes@laas.fr> | 2006-05-23 21:59:28 +0000 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2008-09-05 09:33:47 +0200 |
commit | 8574d367a9de70b2882c0f3393c6b5040d0f6e4d (patch) | |
tree | 608b1ab4f21dbcf45a0fc3aca2d25a14c109640a | |
parent | 53cc0209fad717f4a72f42dfd5ab4d71889d0ccb (diff) | |
download | guile-8574d367a9de70b2882c0f3393c6b5040d0f6e4d.tar.gz |
Removed the free function from the malloc-object SMOB type.
* libguile/mallocs.c (malloc_free): Removed.
(scm_init_mallocs): Don't invoke `scm_set_smob_free ()' because the
memory allocated by `scm_gc_malloc ()' will automatically be freed.
Furthermore, `malloc_free ()' used to invoke `free ()' instead of
`scm_gc_free ()' which is incorrect.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-25
-rw-r--r-- | libguile/mallocs.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/libguile/mallocs.c b/libguile/mallocs.c index 6a68b96e7..0c7d45053 100644 --- a/libguile/mallocs.c +++ b/libguile/mallocs.c @@ -41,14 +41,6 @@ scm_t_bits scm_tc16_malloc; -static size_t -malloc_free (SCM ptr) -{ - if (SCM_MALLOCDATA (ptr)) - free (SCM_MALLOCDATA (ptr)); - return 0; -} - static int malloc_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED) @@ -71,11 +63,10 @@ scm_malloc_obj (size_t n) -void +void scm_init_mallocs () { scm_tc16_malloc = scm_make_smob_type ("malloc", 0); - scm_set_smob_free (scm_tc16_malloc, malloc_free); scm_set_smob_print (scm_tc16_malloc, malloc_print); } |