[Mono-devel-list] Re: Marshaling Tests and fixes

dietmar dietmar at ximian.com
Wed May 7 10:59:30 EDT 2003

Ok, most parts of this patch are now in CVS. But I avoided to add extra
size fields.

- Dietmar

On Tue, 2003-05-06 at 22:01, Jerome Laban wrote:
> Hi dietmar,
> 	Here is an update for the msize/esize to usize/esize patch. I
> stand where I was regarding the udpate. CEE_NEWARRAY takes the number of
> elements as a parameter, which usize/esize is. We're mapulating an
> object/valuetype that contains references to System.Array objects, which
> means that each reference has the size of a (MonoObject*). This is 4
> bytes on my intel machine, and why in the #42240, the size of the
> unmarshalled byte[] array is always 4.
> 	Also I've found an other bug while hunting down this one. The
> problem is quite simple. I have a fixed size structure and the internal
> size of the last field is computed from the total length of the
> unmanaged data and the offset of the field. This might not always be
> true and there might be trailing bytes because of the layout. I've
> included marshal8.cs to test this. (It also tests bug #42240)
> 	To fix an other bug (related to the one above), I had to add the
> field "size" in MonoMarshalField and MonoClassField. I had to insert it
> to know the size of fields (particularily the last one). I guess it
> would have been added anyway to handle some kind of field
> reordering/alignment, in case of automatic layout. I guess this update
> needs to be reviewed more than other ones :)
> 	The diff includes all the previous updates (parent's blittable
> state, marshaling of object hierarchy, explicit structure size and
> internal layout fix, OffsetOf fix). It's kinda hard to separate them as
> many of them are related. I pull one off, many others come with it :)
> 	Note that all marshal*.cs tests pass successfully (even the
> current marshal7.cs that does not pass with current CVS).
> Jerome.

More information about the Mono-devel-list mailing list