diff options
author | Andy Wingo <wingo@pobox.com> | 2010-03-29 22:02:42 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2010-03-29 22:02:42 +0200 |
commit | 0eedfa5cab71cef05e2b9f06d6286d3b8f04ca59 (patch) | |
tree | 4bfc07668f558ec4b92b8e95b2348cad524acda3 /libguile/gc-malloc.c | |
parent | 4e974a1a6d2c0d749bc87bf1b77a519da3e1fe85 (diff) | |
download | guile-0eedfa5cab71cef05e2b9f06d6286d3b8f04ca59.tar.gz |
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.
Diffstat (limited to 'libguile/gc-malloc.c')
-rw-r--r-- | libguile/gc-malloc.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/libguile/gc-malloc.c b/libguile/gc-malloc.c index 37b746e51..e409b6eb2 100644 --- a/libguile/gc-malloc.c +++ b/libguile/gc-malloc.c @@ -244,17 +244,11 @@ scm_gc_strdup (const char *str, const char *what) * scm_done_free * * These functions provide services comparable to malloc, realloc, and - * free. They should be used when allocating memory that will be under - * control of the garbage collector, i.e., if the memory may be freed - * during garbage collection. + * free. * - * They are deprecated because they weren't really used the way - * outlined above, and making sure to return the right amount from - * smob free routines was sometimes difficult when dealing with nested - * 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. + * There has been a fair amount of confusion around the use of these functions; + * see "Memory Blocks" in the manual. They are totally unnecessary in 2.0 given + * the Boehm GC. */ void * @@ -312,7 +306,7 @@ scm_must_free (void *obj) scm_malloc_unregister (obj); #endif - free (obj); + GC_FREE (obj); } #undef FUNC_NAME |