[prev in list] [next in list] [prev in thread] [next in thread]
List: mono-devel-list
Subject: Re: [Mono-dev] Why is UnmanagedType_80 required?
From: Raja R Harinath <rharinath () novell ! com>
Date: 2005-08-31 10:36:04
Message-ID: m3oe7etnej.fsf () harinath ! blr ! novell ! com
[Download RAW message or body]
Hi,
Raja R Harinath <rharinath@novell.com> writes:
> Raja R Harinath <rharinath@novell.com> writes:
>
>> Kornél Pál <kornelpal@hotmail.com> writes:
>>
>>>>> According to my experiences using no ArraySubType has the same result as
>>>>> ArraySubType = (UnmanagedType)80 on mcs and csc.exe as well.
>>>>>
>>>>> Could someone tell me please why UnmanagedType_80 is required?
>>>>
>>>>There was a bug in ancient versions of mcs wrt. constant folding in
>>>>attribute arguments. We needed to declare an explicit enumeration
>>>>constant, and use that instead.
>>>
>>> I think in this case we could simply eliminate UnmanagedType_80 in favour of
>>> using no ArraySubType as I think we support those ancient versions no more.
>>>
>>>>The actual reason for using '(UnmanagetType) 80': probably corcompare.
>>>
>>> Using no ArraySubType and using ArraySubType = (UnmanagedType)80 results in
>>> the same binary file.
>>
>> I don't think so. It will be emitted in the MarshalAsAttribute metadata.
>
> Hmm... I spoke too soon. It's a pseudo-attribute. With no
> ArraySubType specified, the current mcs compiler code seems to set the
> element type of the LParray marshaller to 'int' (I4). ArraySubType set
> to '80' i.e. MAX, specifies to the marshaller that there's "no info"
> about the element type.
>
> Either way, I think there should be a difference in the metadata.
(Sorry for following up to myself so much :-)
It turns out that this behaviour could be a bug in our compiler. CSC
and Mono's SRE appear to behave as you say -- not specifying
ArraySubType acts the same as specifying (UnmanagedType)80.
- Hari
_______________________________________________
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic