summaryrefslogtreecommitdiff
path: root/libguile/gc-malloc.c
diff options
context:
space:
mode:
authorLudovic Courtes <ludovic.courtes@laas.fr>2006-04-04 21:27:23 +0000
committerLudovic Courtès <ludo@gnu.org>2008-09-05 00:46:40 +0200
commitc5018a2bbb4e48c57072b6d9bba35197a7c589fa (patch)
treec4bd4859213f51376c0aa8732c1ebf89a9c727c3 /libguile/gc-malloc.c
parent6a4be32986a1af4aa6cab917b3b62f90b3436476 (diff)
downloadguile-c5018a2bbb4e48c57072b6d9bba35197a7c589fa.tar.gz
Added `scm_gc_malloc_pointerless ()', equivalent to `GC_MALLOC_ATOMIC ()'.
* libguile/gc-malloc.c (scm_gc_register_collectable_memory): Tidied. (scm_gc_unregister_collectable_memory): Likewise. (scm_gc_malloc_pointerless): New. * libguile/gc.h (scm_gc_malloc_pointer_less): New declaration. * libguile/strings.c (make_stringbuf): Use it. git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-5
Diffstat (limited to 'libguile/gc-malloc.c')
-rw-r--r--libguile/gc-malloc.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/libguile/gc-malloc.c b/libguile/gc-malloc.c
index 594bf3553..9ef3d9d05 100644
--- a/libguile/gc-malloc.c
+++ b/libguile/gc-malloc.c
@@ -169,23 +169,32 @@ scm_strdup (const char *str)
void
scm_gc_register_collectable_memory (void *mem, size_t size, const char *what)
{
+ /* Nothing to do. */
#ifdef GUILE_DEBUG_MALLOC
if (mem)
scm_malloc_register (mem);
#endif
- fprintf (stderr, "%s: nothing done\n", __FUNCTION__); /* FIXME: What to do? */
}
void
scm_gc_unregister_collectable_memory (void *mem, size_t size, const char *what)
{
+ /* Nothing to do. */
#ifdef GUILE_DEBUG_MALLOC
if (mem)
scm_malloc_unregister (mem);
#endif
}
+/* Allocate SIZE bytes of memory whose contents should not be scanned for
+ pointers (useful, e.g., for strings). */
+void *
+scm_gc_malloc_pointerless (size_t size, const char *what)
+{
+ return GC_MALLOC_ATOMIC (size);
+}
+
void *
scm_gc_malloc (size_t size, const char *what)
{