diff options
author | Han-Wen Nienhuys <hanwen@lilypond.org> | 2002-08-05 23:04:44 +0000 |
---|---|---|
committer | Han-Wen Nienhuys <hanwen@lilypond.org> | 2002-08-05 23:04:44 +0000 |
commit | ba1b222692b1ee69e51825397bf1368dffd1a28a (patch) | |
tree | bb5043e62736ffb13707dac7f52e43eef8604478 /libguile/gc-malloc.c | |
parent | 3d0f4c6292008ec9b8182455da2dcbe13053c8da (diff) | |
download | guile-ba1b222692b1ee69e51825397bf1368dffd1a28a.tar.gz |
* tests/reader.test: change misc-error in read-error.
* read.c (scm_input_error): new function: give meaningful error
messages, and throw read-error
* gc-malloc.c (scm_calloc): add scm_calloc.
* scheme-memory.texi (Memory Blocks): add scm_calloc, scm_gc_calloc.
correct typos.
Diffstat (limited to 'libguile/gc-malloc.c')
-rw-r--r-- | libguile/gc-malloc.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/libguile/gc-malloc.c b/libguile/gc-malloc.c index 2720ed8d8..86f2b50c1 100644 --- a/libguile/gc-malloc.c +++ b/libguile/gc-malloc.c @@ -142,7 +142,19 @@ scm_malloc (size_t sz) { return scm_realloc (NULL, sz); } - + +/* + Hmm. Should we use the C convention for arguments (i.e. N_ELTS, + SIZEOF_ELT)? --hwn + */ +void * +scm_calloc (size_t sz) +{ + void * ptr = scm_realloc (NULL, sz); + memset (ptr, 0x0, sz); + return ptr; +} + char * scm_strndup (const char *str, size_t n) |