summaryrefslogtreecommitdiff
path: root/doc/ref/scheme-memory.texi
diff options
context:
space:
mode:
authorHan-Wen Nienhuys <hanwen@lilypond.org>2002-08-08 19:47:31 +0000
committerHan-Wen Nienhuys <hanwen@lilypond.org>2002-08-08 19:47:31 +0000
commiteab1b25970c21df7da67bd8f48290a1a1e1bf3d7 (patch)
tree5e1a7d34544a58ef5ddce7f51762b60189325ff6 /doc/ref/scheme-memory.texi
parent00706edc1de5c13bc0552eedf8eec9a5a7ed8802 (diff)
downloadguile-eab1b25970c21df7da67bd8f48290a1a1e1bf3d7.tar.gz
* gc.h: add scm_debug_cells_gc_interval to public interface
* gc-card.c ("sweep_card"): set scm_gc_running while sweeping. * gc.c (scm_i_expensive_validation_check): separate expensive validation checks from cheap ones.
Diffstat (limited to 'doc/ref/scheme-memory.texi')
-rw-r--r--doc/ref/scheme-memory.texi17
1 files changed, 13 insertions, 4 deletions
diff --git a/doc/ref/scheme-memory.texi b/doc/ref/scheme-memory.texi
index 8fad86466..ea3f8bfd1 100644
--- a/doc/ref/scheme-memory.texi
+++ b/doc/ref/scheme-memory.texi
@@ -76,6 +76,7 @@ For really specialized needs, take at look at
@code{scm_gc_unregister_collectable_memory}.
@deftypefn {C Function} void *scm_malloc (size_t @var{size})
+@deftypefnx {C Function} void *scm_calloc (size_t @var{size})
Allocate @var{size} bytes of memory and return a pointer to it. When
@var{size} is 0, return @code{NULL}. When not enough memory is
available, signal an error. This function runs the GC to free up some
@@ -85,6 +86,9 @@ The memory is allocated by the libc @code{malloc} function and can be
freed with @code{free}. There is no @code{scm_free} function to go
with @code{scm_malloc} to make it easier to pass memory back and forth
between different modules.
+
+The function @code{scm_calloc} is similar to @code{scm_malloc}, but
+initializes the block of memory to zero as well.
@end deftypefn
@deftypefn {C Function} void *scm_realloc (void *@var{mem}, size_t @var{new_size})
@@ -98,6 +102,9 @@ When not enough memory is available, signal an error. This function
runs the GC to free up some memory when it deems it appropriate.
@end deftypefn
+
+
+
@deftypefn {C Function} void scm_gc_register_collectable_memory (void *@var{mem}, size_t @var{size}, const char *@var{what})
Informs the GC that the memory at @var{mem} of size @var{size} can
potentially be freed during a GC. That is, announce that @var{mem} is
@@ -127,12 +134,14 @@ much less efficiently than it could.
@deftypefn {C Function} void *scm_gc_malloc (size_t @var{size}, const char *@var{what})
@deftypefnx {C Function} void *scm_gc_realloc (void *@var{mem}, size_t @var{old_size}, size_t @var{new_size}, const char *@var{what});
-Like @code{scm_malloc} or @code{scm_realloc}, but also call
-@code{scm_gc_register_collectable_memory}. Note that you need to pass
-the old size of a reallocated memory block as well. See below for a
-motivation.
+@deftypefnx {C Function} void *scm_gc_calloc (size_t @var{size}, const char *@var{what})
+Like @code{scm_malloc}, @code{scm_realloc} or @code{scm_calloc}, but
+also call @code{scm_gc_register_collectable_memory}. Note that you
+need to pass the old size of a reallocated memory block as well. See
+below for a motivation.
@end deftypefn
+
@deftypefn {C Function} void scm_gc_free (void *@var{mem}, size_t @var{size}, const char *@var{what})
Like @code{free}, but also call @code{scm_gc_unregister_collectable_memory}.