mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
fix bug in scm_must_free
* libguile/gc-malloc.c: Update a comment. (scm_must_free): Must be able to free memory allocated with scm_must_malloc, and thus must be GC_FREE, not free.
This commit is contained in:
parent
4e974a1a6d
commit
0eedfa5cab
1 changed files with 5 additions and 11 deletions
|
@ -244,17 +244,11 @@ scm_gc_strdup (const char *str, const char *what)
|
||||||
* scm_done_free
|
* scm_done_free
|
||||||
*
|
*
|
||||||
* These functions provide services comparable to malloc, realloc, and
|
* These functions provide services comparable to malloc, realloc, and
|
||||||
* free. They should be used when allocating memory that will be under
|
* free.
|
||||||
* control of the garbage collector, i.e., if the memory may be freed
|
|
||||||
* during garbage collection.
|
|
||||||
*
|
*
|
||||||
* They are deprecated because they weren't really used the way
|
* There has been a fair amount of confusion around the use of these functions;
|
||||||
* outlined above, and making sure to return the right amount from
|
* see "Memory Blocks" in the manual. They are totally unnecessary in 2.0 given
|
||||||
* smob free routines was sometimes difficult when dealing with nested
|
* the Boehm GC.
|
||||||
* data structures. We basically want everybody to review their code
|
|
||||||
* and use the more symmetrical scm_gc_malloc/scm_gc_free functions
|
|
||||||
* instead. In some cases, where scm_must_malloc has been used
|
|
||||||
* incorrectly (i.e. for non-GC-able memory), use scm_malloc/free.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void *
|
void *
|
||||||
|
@ -312,7 +306,7 @@ scm_must_free (void *obj)
|
||||||
scm_malloc_unregister (obj);
|
scm_malloc_unregister (obj);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
free (obj);
|
GC_FREE (obj);
|
||||||
}
|
}
|
||||||
#undef FUNC_NAME
|
#undef FUNC_NAME
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue