I am creating a decompiler from IL (Compiled C#\VB code). Is there any way to create reference in C?
Edit:
I want something faster than pointer like stack. Is there a thing like that?
I am creating a decompiler from IL (Compiled C#\VB code). Is there any way to create reference in C?
Edit:
I want something faster than pointer like stack. Is there a thing like that?
A reference is just a syntactically sugar-coated pointer–a pointer will do just fine.
Stack and pointer are two completely independent concepts.
A reference is just like a pointer, a way to access/pass a variable without copying it. On the other hand, stack and heap are two different places where variables live. The decision whether or not a variable should live on the stack or on the heap is totally independent from the way you pass it around.
If heap allocation is indeed a performance bottleneck, you should make sure that you use automatic variables (on stack) where possible. Then, do profiling of your allocation patterns. And finally optimize your allocation strategy.