Skip to main content
Filter by
Sorted by
Tagged with
4 votes
1 answer
129 views

I'm working on a JIT compiler for MIPS machine emulation to translate MIPS to CLI. I'm working on getting a nearly hard-coded Shift method, but whenever I try to execute the operation instruction on a ...
Avishai Dernis's user avatar
0 votes
0 answers
40 views

I found out about this instruction today and wanted to try it out. Sadly, ILASM doesn't seem to recognize it. That's why I decided to manually patch the generated assembly to add in the instruction. I ...
Jonas _'s user avatar
  • 172
1 vote
0 answers
114 views

I find myself occasionally annoyed by the empty constructor of C# struct types. Unlike classes, there's no way enforce that struct fields are initialized to non-default values, since all structs have ...
John V's user avatar
  • 1,393
1 vote
1 answer
73 views

In a program I'm writing, I'm faced with a recursive type that I want to go through recursively (it seems necessary). Out of curiosity, I wanted to try and write a tail recursive version of my code, ...
Foxy's user avatar
  • 1,295
4 votes
1 answer
127 views

According to boxing on structs when calling ToString(), calling an unoverridden method on a C# struct causes it to be boxed. This is ultimately because of how the constrained callvirt IL instruction ...
palapapa's user avatar
  • 1,051
1 vote
1 answer
1k views

I'm working with VS 17.11, and MAUI 8. There are a lot of articles about "dependency injection", including on a platform basis. But something like this seems possible too: #if IOS ...
bobwki's user avatar
  • 982
1 vote
1 answer
135 views

When I was conducting the following benchmark test, the benchmark information indicated that there was no additional memory allocation. However, doesn't converting a struct to an interface involve ...
ZinSunrise's user avatar
1 vote
1 answer
60 views

I'm trying to use Mono.Cecil to weave in some instrumentation code into existing methods - basically just a log before all the sequence points. This is simple, I can iterate over all of the sequence ...
Peter Lenkefi's user avatar
0 votes
0 answers
87 views

In the preceding C# code, I'm creating a dynamic method and adding a few IL instructions to it, and then invoking the dynamic method: var assemblyBuilder = AssemblyBuilder.DefineDynamicAssembly(new(&...
winscripter's user avatar
  • 1,790
-2 votes
1 answer
144 views

In C# one can make a positive int negative using the minus sign - like so: var positiveInt = 5; var negativeInt = -positiveInt; Is there an extra operation taking place under the hood when doing this ...
user3163495's user avatar
  • 4,104
3 votes
1 answer
244 views

I used ILSpy on my code from curiosity, and I noticed that if (1 == 0) empty instructions were added around return x switch statements. Here is an example of this behavior: public static string ...
Arkane's user avatar
  • 440
0 votes
0 answers
110 views

This question is a follow up on Unhandled exception: System.IO.FileNotFoundException: The file or assembly "System.Private.CoreLib" could not be found in custom generated assmbly. I ...
Noraa Junker-Wildi's user avatar
1 vote
2 answers
97 views

I have this IL code from Expert .NET 2.0 IL Assembler by Serge Lidin: This is in a file called CilTest.il: //----------- Program header .assembly extern mscorlib { auto } .assembly OddOrEven { } ....
David Klempfner's user avatar
0 votes
0 answers
31 views

We have a C#/.NET application running as a Windows Service. Infrequently, it logs several entries of the following form in the Windows Event Viewer. Log Name: Application Source: Windows Error ...
A.M.'s user avatar
  • 44
1 vote
0 answers
148 views

I have been using the following method to redirect a C# method into another at runtime: public class Injection { public static void install(MethodInfo methodToReplace, ...
ysabih2's user avatar
  • 49

15 30 50 per page
1
2 3 4 5
105