Author: chromatic
Date: Sat May 26 17:27:15 2007
New Revision: 18650

Modified:
   trunk/include/parrot/memory.h
   trunk/src/gc/memory.c
   trunk/src/string.c

Log:
[GC] Undo the consting of free() calls (Steve Peters, RT #43033; see also RT 
#42961).

Modified: trunk/include/parrot/memory.h
==============================================================================
--- trunk/include/parrot/memory.h       (original)
+++ trunk/include/parrot/memory.h       Sat May 26 17:27:15 2007
@@ -19,7 +19,7 @@
 
 PARROT_API void *mem__sys_realloc(void *, size_t);
 #define mem_sys_realloc(x,y) (assert(x!=NULL), mem__sys_realloc(x,y))
-PARROT_API void mem_sys_free(const void * const);
+PARROT_API void mem_sys_free(void *);
 
 void *mem__internal_allocate(size_t, const char *, int);
 #define mem_internal_allocate(x) mem__internal_allocate(x, __FILE__, __LINE__)

Modified: trunk/src/gc/memory.c
==============================================================================
--- trunk/src/gc/memory.c       (original)
+++ trunk/src/gc/memory.c       Sat May 26 17:27:15 2007
@@ -153,13 +153,13 @@
 */
 
 void
-mem_sys_free(const void * const from)
+mem_sys_free(void * from)
 {
 #ifdef DETAIL_MEMORY_DEBUG
     fprintf(stderr, "Freed %p\n", from);
 #endif
     if (from)
-        free((void *)from);
+        free(from);
 }
 
 void

Modified: trunk/src/string.c
==============================================================================
--- trunk/src/string.c  (original)
+++ trunk/src/string.c  Sat May 26 17:27:15 2007
@@ -1880,7 +1880,8 @@
 void
 string_cstring_free(const char * const p)
 {
-    mem_sys_free(p);
+    DECL_CONST_CAST;
+    mem_sys_free((void *)const_cast(p));
 }
 
 /*

Reply via email to