chromatic wrote:
Jonathan, can you help us figure out why deleting these lines out of init() 
fixes the problem?  Are they vestigial?

            /* turn on marking of the class_data array */
            PObj_data_is_PMC_array_SET(self);
I saw those before and thought they were very suspect; I only gave SMOP a cursory glance for inspiration before digging into PDD15 implementation though. When you set this flag, I believe the GC assumes the data pointer of the PMC points to a chunk of memory containing an array of pointers. It then looks at the int in the pmc_ext structure to say how many pointers there are. That way you don't have to write your own mark routine for some aggregate types. I may have the specific details wrong, but it's something like that.

I think in the case of SMOP, the usage of it is bogus/wrong. I don't remember the int in pmc_ext being set, and assuming that everything in a struct is and always will be contiguous non-NULL PMCs or STRING pointers is probably a fast way to segfaults when you change something about the struct in the future, or if it's uninitialized.

I expect custom mark and destroy are the flags that should be set, and the mark and destroy vtable methods implemented. As for the more general future of SMOP, I'm don't know.

Hope this helps,

Jonathan

Reply via email to