[Mono-dev] Strange enum issue

Marek Safar marek.safar at gmail.com
Tue Mar 10 21:44:10 UTC 2015


Hi Neale,

>
> ves_icall_System_Enum_GetEnumValuesAndNames.3229: 0. field=System_Runtime
> value=0
> ves_icall_System_Enum_GetEnumValuesAndNames.3229: 1.
> field=System_Runtime_InteropServices_WindowsRuntime value=16777216
> ves_icall_System_Enum_GetEnumValuesAndNames.3229: 2.
> field=System_ObjectModel value=33554432
> ves_icall_System_Enum_GetEnumValuesAndNames.3229: 3.
> field=System_Runtime_WindowsRuntime value=50331648
> ves_icall_System_Enum_GetEnumValuesAndNames.3229: 4.
> field=System_Runtime_WindowsRuntime_UI_Xaml value=67108864
> ves_icall_System_Enum_GetEnumValuesAndNames.3229: 5. field=Count
> value=83886080
>
> Note 16777216 is hex 10000000. Now to find out how that value gets placed
> there and to do some byte swapping on it.
>

You are probably looking for
https://github.com/mono/mono/blob/master/mono/metadata/icall.c#L2961. There
has been no endian changes there for years but due to different codepath
this is now hit more often before.

Marek

P.S. I am wondering if it would be worth it to create a routine or more in
> icall.c to do the byte swap for 2/4/8 byte integers rather than coding up
> clumsy stuff in managed code.
>
> On 3/10/15, 3:01 PM, "Robert Jordan" <robertj at gmx.net> wrote:
>
> >There was a recent commit which added MS' reference source Enum
> >support to Mono:
> >
> >
> https://github.com/mono/mono/commit/65dba595eaea2c871d1f72fbdc04f6440350af
> >96
> >
> >Maybe it's an endian-related issue.
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20150310/0f9ccf91/attachment.html>


More information about the Mono-devel-list mailing list