From: Christophe Poucet Date: 2005-10-05T23:21:06+09:00 Subject: Re: Concerning shared flag ------=_Part_22264_6595717.1128522063097 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hello, I'm not trying to modify ruby at the moment (except for the porting to c++ which I did). Basically I want to make a complete copy of array.c except that it will use some profiling templates that I use. At first I just modified array.c and that worked fine, but I was getting spurious writes because the method-call and exception mechanisms use array. Hence I decided to make my own type which would mimic Array as close as possible. At first = I thought of building a new T_VARARRAy, however that would mean extensive changing in gc.c and other places. Therefore I decided to use T_DATA with a struct in the data pointer. However unless I add an EXTRA field to the data struct that is a flag deciding whether a the data is shared or not I am not able to mimic the sharing behaviour. This is due to the fact that for T_ARRAY the gc has special logic for shared data using the general flag FL_SHARED (which is nonetheless defined for ALL objects). Hence what I propose is that even for T_DATA there is two different possible behaviours for marking and freeing depending on the general setting of the flag FL_SHARED. With regards Christophe On 10/5/05, ts wrote: > > >>>>> "C" =3D=3D Christophe Poucet writes: > > C> I'm trying to build an object that behaves just like Array in c. > However > C> there seems to be one stumbling block. I looked at the garbage > collector > C> and there is no special case in T_DATA in case an object has the flag > C> shared. I think there should be two different marking functions in cas= e > C> an object has the set and in the case it does not. > > Before trying to modify ruby, why you don't try first to explain your > problem (perhaps best on ruby-talk). > > > Guy Decoux > > > ------=_Part_22264_6595717.1128522063097--