summaryrefslogtreecommitdiff
path: root/libguile/strings.c
diff options
context:
space:
mode:
authorMarius Vollmer <mvo@zagadka.de>2002-02-11 18:06:50 +0000
committerMarius Vollmer <mvo@zagadka.de>2002-02-11 18:06:50 +0000
commit4c9419ac31f8364db51ccf25f7f9d5d31dd412e7 (patch)
treeecce968212c4bda96b3531e61b9724ea93777cc7 /libguile/strings.c
parentd013f095c14783c193385cb67d3778a1240cd19b (diff)
downloadguile-4c9419ac31f8364db51ccf25f7f9d5d31dd412e7.tar.gz
* gc.h, gc.c (scm_gc_sweep): Issue deprecation warning when
non-zero is returned from a port or smob free function. (scm_malloc, scm_realloc, scm_strndup, scm_strdup, scm_gc_register_collectable_memory, scm_gc_unregister_collectable_memory, scm_gc_malloc, scm_gc_realloc, scm_gc_free, scm_gc_strndup, scm_gc_strdup): New. * backtrace.c, continuations.c, convert.i.c, coop-threads.c, debug-malloc.c, dynl.c, environments.c, environments.h, extensions.c, filesys.c, fports.c, gc.c, gc.h, gh_data.c, goops.c, guardians.c, hooks.c, init.c, keywords.c, load.c, numbers.c, ports.c, posix.c, procs.c, rdelim.c, regex-posix.c, root.c, smob.c, stime.c, strings.c, struct.c, struct.h, symbols.c, unif.c, vectors.c, weaks.c: Use scm_gc_malloc/scm_malloc and scm_gc_free/free instead of scm_must_malloc and scm_must_free, as appropriate. Return zero from smob and port free functions. * debug-malloc.c (scm_malloc_reregister): Handle "old == NULL". * fports.c (scm_setvbuf): Reset read buffer to saved values when it is pointing to the putback buffer.
Diffstat (limited to 'libguile/strings.c')
-rw-r--r--libguile/strings.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libguile/strings.c b/libguile/strings.c
index 6744a58c6..c7517626d 100644
--- a/libguile/strings.c
+++ b/libguile/strings.c
@@ -133,7 +133,7 @@ scm_take_str (char *s, size_t len)
SCM_ASSERT_RANGE (2, scm_ulong2num (len), len <= SCM_STRING_MAX_LENGTH);
answer = scm_alloc_cell (SCM_MAKE_STRING_TAG (len), (scm_t_bits) s);
- scm_done_malloc (len + 1);
+ scm_gc_register_collectable_memory (s, len+1, "string");
return answer;
}
@@ -191,7 +191,7 @@ scm_allocate_string (size_t len)
SCM_ASSERT_RANGE (1, scm_long2num (len), len <= SCM_STRING_MAX_LENGTH);
- mem = (char *) scm_must_malloc (len + 1, FUNC_NAME);
+ mem = (char *) scm_gc_malloc (len + 1, "string");
mem[len] = 0;
s = scm_alloc_cell (SCM_MAKE_STRING_TAG (len), (scm_t_bits) mem);