/[guile]/guile/guile-core/doc/ref/scheme-memory.texi
ViewVC logotype

Diff of /guile/guile-core/doc/ref/scheme-memory.texi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.10 by hanwen, Mon Aug 5 23:04:43 2002 UTC revision 1.11 by hanwen, Thu Aug 8 19:47:31 2002 UTC
# Line 76  For really specialized needs, take at lo Line 76  For really specialized needs, take at lo
76  @code{scm_gc_unregister_collectable_memory}.  @code{scm_gc_unregister_collectable_memory}.
77    
78  @deftypefn {C Function} void *scm_malloc (size_t @var{size})  @deftypefn {C Function} void *scm_malloc (size_t @var{size})
79    @deftypefnx {C Function} void *scm_calloc (size_t @var{size})
80  Allocate @var{size} bytes of memory and return a pointer to it.  When  Allocate @var{size} bytes of memory and return a pointer to it.  When
81  @var{size} is 0, return @code{NULL}.  When not enough memory is  @var{size} is 0, return @code{NULL}.  When not enough memory is
82  available, signal an error.  This function runs the GC to free up some  available, signal an error.  This function runs the GC to free up some
# Line 85  The memory is allocated by the libc @cod Line 86  The memory is allocated by the libc @cod
86  freed with @code{free}.  There is no @code{scm_free} function to go  freed with @code{free}.  There is no @code{scm_free} function to go
87  with @code{scm_malloc} to make it easier to pass memory back and forth  with @code{scm_malloc} to make it easier to pass memory back and forth
88  between different modules.  between different modules.
89    
90    The function @code{scm_calloc} is similar to @code{scm_malloc}, but
91    initializes the block of memory to zero as well.
92  @end deftypefn  @end deftypefn
93    
94  @deftypefn {C Function} void *scm_realloc (void *@var{mem}, size_t @var{new_size})  @deftypefn {C Function} void *scm_realloc (void *@var{mem}, size_t @var{new_size})
# Line 98  When not enough memory is available, sig Line 102  When not enough memory is available, sig
102  runs the GC to free up some memory when it deems it appropriate.  runs the GC to free up some memory when it deems it appropriate.
103  @end deftypefn  @end deftypefn
104    
105    
106    
107    
108  @deftypefn {C Function} void scm_gc_register_collectable_memory (void *@var{mem}, size_t @var{size}, const char *@var{what})  @deftypefn {C Function} void scm_gc_register_collectable_memory (void *@var{mem}, size_t @var{size}, const char *@var{what})
109  Informs the GC that the memory at @var{mem} of size @var{size} can  Informs the GC that the memory at @var{mem} of size @var{size} can
110  potentially be freed during a GC.  That is, announce that @var{mem} is  potentially be freed during a GC.  That is, announce that @var{mem} is
# Line 127  much less efficiently than it could. Line 134  much less efficiently than it could.
134    
135  @deftypefn {C Function} void *scm_gc_malloc (size_t @var{size}, const char *@var{what})  @deftypefn {C Function} void *scm_gc_malloc (size_t @var{size}, const char *@var{what})
136  @deftypefnx {C Function} void *scm_gc_realloc (void *@var{mem}, size_t @var{old_size}, size_t @var{new_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});
137  Like @code{scm_malloc} or @code{scm_realloc}, but also call  @deftypefnx {C Function} void *scm_gc_calloc (size_t @var{size}, const char *@var{what})
138  @code{scm_gc_register_collectable_memory}.  Note that you need to pass  Like @code{scm_malloc}, @code{scm_realloc} or @code{scm_calloc}, but
139  the old size of a reallocated memory block as well.  See below for a  also call @code{scm_gc_register_collectable_memory}.  Note that you
140  motivation.  need to pass the old size of a reallocated memory block as well.  See
141    below for a motivation.
142  @end deftypefn  @end deftypefn
143    
144    
145  @deftypefn {C Function} void scm_gc_free (void *@var{mem}, size_t @var{size}, const char *@var{what})  @deftypefn {C Function} void scm_gc_free (void *@var{mem}, size_t @var{size}, const char *@var{what})
146  Like @code{free}, but also call @code{scm_gc_unregister_collectable_memory}.  Like @code{free}, but also call @code{scm_gc_unregister_collectable_memory}.
147    

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26