On Fri, Mar 29, 2002 at 03:25:19AM -0500, Michel J Lambert wrote: > The attached patch fixes a bunch of bugs. They are: > > >From before, rolled into this patch: > + Creates a new flag, immortal, which is intended for GC use only, so it > shouldn't be set in the init() function. This is used to prevent the GC > from dod'ing the object. > + PerlString now stores the string pointer in data instead of > cache.struct_val . > + buffer_ptrs work properly now, and check that they point to something > before calling buffer_lives on it. > > New fixes in this patch: > + new_string_header nulls out the bufstart before returning it. This was > causing problems when 'bufstart = parrot_allocate...' was causing a > do_collect to be run, and it was referencing invalid memory. I also made > new_pmc_header null out the data field as well, for consistency, and > removed the nulling-out in pmc_new*. > + Changed a conditional in stack_entry so that it looks up entry in the > correct place in a borderline case. > + Fixed the same thing that Peter Gibb's patched fixed wrt the GC linked > list bug, but in what I think is a more efficient way. the next_for_GC > linked list now *requires* that the tail element point to itself. This > hack (I think this is a good hack, not a bad one, if documented) > determines the 'end-of-list'. This allows the same logic to be used in > mark_used to determine if the element is on the linked list. It avoids the > need to add additional conditional branches into mark_used, which is > probably a hotspot of the memory manager (haven't verified this, however). > > Please let me know if there are any issues with this that I should > address. > > Mike Lambert
It looks good to me, with one caveat. 'immortal' sounds wrong to me, since that has another (useful) meaning -- the Java VM, for example, has an separate area for immortal data. It's used for stuff like the metadata for loaded classes. I would suggest 'immune'. Opinions? -- WM ISO JOB. http://foxglove.dnsalias.org/~sfink/job.html C, perl, networking, performance optimization, Java, XML.