[Mono-devel-list] Marshaling Tests and fixes
Jerome Laban
jlaban at wanadoo.fr
Tue May 6 16:01:55 EDT 2003
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: marshal8.cs
Type: application/octet-stream
Size: 1704 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20030506/45dfa0b8/attachment.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: marshaling-20030506.diff
Type: application/octet-stream
Size: 9756 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20030506/45dfa0b8/attachment-0001.obj
More information about the Mono-devel-list
mailing list