At 6:43 PM -0400 4/18/02, Mike Lambert wrote:
>Undoing the patch in resources.c seems to fix the problem.
>
>Changing:
>     ((Buffer *)buffer)->buflen = req_size;
>to:
>     ((Buffer *)buffer)->buflen = size;
>makes it work again.
>
>Looking into it a bit more, this seems like a 'bad' patch.

I agree. That bit has been undone.

>Take, for
>example, resize_array in array.pmc. If I call resize_array( interp, self,
>1 ), my array will contain four elements (with  four-byte pointers), due
>to the up-rounding. When I go to GC on this, assuming these are all
>PMC*'s, it's extremely possible those latter three won't be set to any
>valid values.

Actually, the extra is guaranteed to be filled with nulls. Allocation 
of the base memory chunks is done with calloc. Still, this will cause 
things to die a horrid death, so... away it goes.

I might add in a version of allocate that can overshoot for those 
cases where it might be useful, but that's for later.

-- 
                                         Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                       teddy bears get drunk

Reply via email to