26 |
use of storage. |
use of storage. |
27 |
@end deffn |
@end deffn |
28 |
|
|
29 |
|
|
30 |
@node Memory Blocks |
@node Memory Blocks |
31 |
@section Memory Blocks |
@section Memory Blocks |
32 |
|
|
81 |
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. |
82 |
@end deftypefn |
@end deftypefn |
83 |
|
|
|
|
|
84 |
@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}) |
85 |
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 |
86 |
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 |
108 |
much less efficiently than it could. |
much less efficiently than it could. |
109 |
@end deftypefn |
@end deftypefn |
110 |
|
|
|
|
|
111 |
@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}) |
112 |
@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}); |
113 |
Like @code{scm_malloc} or @code{scm_realloc}, but also call |
Like @code{scm_malloc} or @code{scm_realloc}, but also call |
126 |
the memory management overhead very low. |
the memory management overhead very low. |
127 |
@end deftypefn |
@end deftypefn |
128 |
|
|
129 |
|
@deffn {Scheme Procedure} malloc-stats |
130 |
|
Return an alist ((@var{what} . @var{n}) ...) describing number |
131 |
|
of malloced objects. |
132 |
|
@var{what} is the second argument to @code{scm_gc_malloc}, |
133 |
|
@var{n} is the number of objects of that type currently |
134 |
|
allocated. |
135 |
|
@end deffn |
136 |
|
|
137 |
|
|
138 |
@subsection Upgrading from scm_must_malloc et al |
@subsection Upgrading from scm_must_malloc et al. |
139 |
|
|
140 |
Version 1.6 of Guile and earlier did not have the functions from the |
Version 1.6 of Guile and earlier did not have the functions from the |
141 |
previous section. In their place, it had the functions |
previous section. In their place, it had the functions |
191 |
The same reasoning applies to @code{scm_must_realloc} and |
The same reasoning applies to @code{scm_must_realloc} and |
192 |
@code{scm_realloc} versus @code{scm_gc_realloc}. |
@code{scm_realloc} versus @code{scm_gc_realloc}. |
193 |
|
|
194 |
|
|
195 |
@node Weak References |
@node Weak References |
196 |
@section Weak References |
@section Weak References |
197 |
|
|