Author: heimdall
Date: Thu Aug 18 18:15:53 2005
New Revision: 8993
Modified:
branches/gmc/src/gc_gmc.c
branches/gmc/src/string.c
Log:
A string was allocated in the heap before, which obviously won't work anymore
in GMC. make test better (77/89% passed)
Modified: branches/gmc/src/gc_gmc.c
==============================================================================
--- branches/gmc/src/gc_gmc.c (original)
+++ branches/gmc/src/gc_gmc.c Thu Aug 18 18:15:53 2005
@@ -230,6 +230,7 @@ static int sweep_pmc (Interp *interprete
PMC *ptr;
Gc_gmc_area_store *store;
Gc_gmc_header_area *area;
+ /* Go through all the headers of the pool. */
for (store = pool->areas->first; store; store = store->next)
{
for (area = store->store[0]; (UINTVAL)area < (UINTVAL)store->ptr;
area++)
@@ -244,7 +245,7 @@ static int sweep_pmc (Interp *interprete
--arena_base->num_early_DOD_PMCs;
if (PObj_active_destroy_TEST(ptr))
VTABLE_destroy(interpreter, ptr);
- if (Gmc_has_PMC_EXT_TEST(ptr) && PMC_data(ptr))
+ if ((Gmc_has_PMC_EXT_TEST(ptr) ||
PObj_is_PMC_EXT_TEST(ptr)) && PMC_data(ptr))
{
mem_sys_free(PMC_data(ptr));
PMC_data(ptr) = NULL;
Modified: branches/gmc/src/string.c
==============================================================================
--- branches/gmc/src/string.c (original)
+++ branches/gmc/src/string.c Thu Aug 18 18:15:53 2005
@@ -65,7 +65,12 @@ Parrot_unmake_COW(Interp *interpreter, S
{
/* COW_FLAG | constant_FLAG | external_FLAG) */
if (PObj_is_cowed_TESTALL(s)) {
+#if PARROT_GC_GMC
+ STRING *for_alloc_ptr = new_string_header(interpreter, 0);
+ STRING for_alloc = *for_alloc_ptr;
+#else
STRING for_alloc;
+#endif
/* Create new pool data for this header to use,
* independent of the original COW data */
@@ -500,6 +505,7 @@ string_append(Interp *interpreter,
if ( (cs = string_rep_compatible(interpreter, a, b, NULL))) {
a->charset = cs;
/* Tack B on the end of A */
+
mem_sys_memcopy((void *)((ptrcast_t)a->strstart + a->bufused),
b->strstart, b->bufused);