76 |
@code{scm_gc_register_collectable_memory} and |
@code{scm_gc_register_collectable_memory} and |
77 |
@code{scm_gc_unregister_collectable_memory}. |
@code{scm_gc_unregister_collectable_memory}. |
78 |
|
|
79 |
@deftypefn {C Function} void *scm_malloc (size_t @var{size}) |
@deftypefn {C Function} {void *} scm_malloc (size_t @var{size}) |
80 |
@deftypefnx {C Function} void *scm_calloc (size_t @var{size}) |
@deftypefnx {C Function} {void *} scm_calloc (size_t @var{size}) |
81 |
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 |
82 |
@var{size} is 0, return @code{NULL}. When not enough memory is |
@var{size} is 0, return @code{NULL}. When not enough memory is |
83 |
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 |
92 |
initializes the block of memory to zero as well. |
initializes the block of memory to zero as well. |
93 |
@end deftypefn |
@end deftypefn |
94 |
|
|
95 |
@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}) |
96 |
Change the size of the memory block at @var{mem} to @var{new_size} and |
Change the size of the memory block at @var{mem} to @var{new_size} and |
97 |
return its new location. When @var{new_size} is 0, this is the same |
return its new location. When @var{new_size} is 0, this is the same |
98 |
as calling @code{free} on @var{mem} and @code{NULL} is returned. When |
as calling @code{free} on @var{mem} and @code{NULL} is returned. When |
133 |
much less efficiently than it could. |
much less efficiently than it could. |
134 |
@end deftypefn |
@end deftypefn |
135 |
|
|
136 |
@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}) |
137 |
@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}); |
138 |
@deftypefnx {C Function} void *scm_gc_calloc (size_t @var{size}, const char *@var{what}) |
@deftypefnx {C Function} {void *} scm_gc_calloc (size_t @var{size}, const char *@var{what}) |
139 |
Like @code{scm_malloc}, @code{scm_realloc} or @code{scm_calloc}, but |
Like @code{scm_malloc}, @code{scm_realloc} or @code{scm_calloc}, but |
140 |
also call @code{scm_gc_register_collectable_memory}. Note that you |
also call @code{scm_gc_register_collectable_memory}. Note that you |
141 |
need to pass the old size of a reallocated memory block as well. See |
need to pass the old size of a reallocated memory block as well. See |