[Mono-devel-list] fixed statement
Eric Durand Tremblay
eric.durand-tremblay.1 at ulaval.ca
Thu Mar 18 12:09:56 EST 2004
Hi all, thank you for your response.
I have an other related question.
mcs output some "conv.i". I can run the same IL without any "conv.i"
and it work perfectly.
I know "conv.i" is used to convert in "natural int". Is it due to the
fact that in some platform, pointers can not be added ( or any other
arithmetic operation) directly?
So, is it better to keep them (in CIL Regex, I don't talk about mcs).
Thanks.
Eric Durand Tremblay.
Eric Durand Tremblay a écrit :
> Can somebody tell me how mono handle fixed statement.
>
> For something like this :
>
> string bar = "something";
>
> fixed ( char * foo = bar) {
> foo[0] = 'c';
> }
>
> MCS output :
>
> IL_0000: ldstr "bar"
> IL_0005: stloc.1
> IL_0006: ldloc.1
> IL_0007: stloc.2
> IL_0008: ldloc.2
> IL_0009: conv.i
> IL_000a: call int32 class
> [mscorlib]'System.Runtime.CompilerServices.RuntimeHelpers'::'get_OffsetToStringData'()
>
> IL_000f: add
> IL_0010: stloc.0
> IL_0011: ldloc.0
> IL_0012: conv.i
> IL_0013: ldc.i4.0
> IL_0014: ldc.i4.2
> IL_0015: mul
> IL_0016: conv.i
> IL_0017: add
> IL_0018: ldc.i4.s 0x63
> IL_001a: stind.i2
> IL_001b: ldnull
> IL_001c: stloc.2
> IL_001d: ret
>
> There is nothing in this that "lock" the garbage collector
> (msdn define lock as: Prevents relocation of a variable by the garbage
> collector.)
>
> Thanks
>
> Eric Durand-Tremblay
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
More information about the Mono-devel-list
mailing list