Clinton

The following patch seems to fix both these problems. It makes some slight
changes to the logic, so should be considered a temporary fix until Dan has
time to take a look at the code.

--
Peter Gibbs
EmKel Systems

Index: resources.c
===================================================================
RCS file: /home/perlcvs/parrot/resources.c,v
retrieving revision 1.35
diff -c -r1.35 resources.c
*** resources.c 26 Mar 2002 16:33:01 -0000  1.35
--- resources.c 28 Mar 2002 13:40:37 -0000
***************
*** 338,344 ****
 /* If the PMC we've been handed has already been marked as live
 (ie we put it on the list already) we just return. Otherwise we
 could get in some nasty loops */
!     if (used_pmc->next_for_GC) {
 return current_end_of_list;
 }

--- 338,344 ----
 /* If the PMC we've been handed has already been marked as live
 (ie we put it on the list already) we just return. Otherwise we
 could get in some nasty loops */
!     if (used_pmc->next_for_GC || used_pmc == current_end_of_list) {
 return current_end_of_list;
 }

***************
*** 346,352 ****
      used_pmc->flags |= PMC_live_FLAG;

      /* Now put it on the end of the list */
!     current_end_of_list->next_for_GC = used_pmc;

      /* return the PMC we were passed as the new end of the list */
      return used_pmc;
--- 346,354 ----
      used_pmc->flags |= PMC_live_FLAG;

      /* Now put it on the end of the list */
!     if (current_end_of_list) {
!         current_end_of_list->next_for_GC = used_pmc;
!     }

      /* return the PMC we were passed as the new end of the list */
      return used_pmc;
***************
*** 362,373 ****
      struct PRegChunk *cur_chunk;
      /* We have to start somewhere, and the global stash is a good
         place */
!     last = current = interpreter->perl_stash->stash_hash;
      /* mark it as used and get an updated end of list */
      last = mark_used(current, last);

      /* Wipe out the next for gc bit, otherwise we'll never get anywhere */
!     last->next_for_GC = NULL;

      /* Now, go run through the PMC registers and mark them as live */
      /* First mark the current set. */
--- 364,376 ----
      struct PRegChunk *cur_chunk;
      /* We have to start somewhere, and the global stash is a good
         place */
!     current = interpreter->perl_stash->stash_hash;
!     last = NULL;
      /* mark it as used and get an updated end of list */
      last = mark_used(current, last);

      /* Wipe out the next for gc bit, otherwise we'll never get anywhere */
!     /* last->next_for_GC = NULL; */

      /* Now, go run through the PMC registers and mark them as live */
      /* First mark the current set. */



Reply via email to