A variable of type dynamic is a System.Object at runtime. So it is always a reference to an object that's stored on the GC heap. If you assign a value type value to the variable then it will be boxed with a standard boxing conversion.
Where are the values of variables marked as 'dynamic' stored?
-
10-03-2022 - |
Domanda
On .net, value types are stored on the stack and reference types on the heap (and it's reference on the stack).
But if a variable is marked as dynamic
, is this rule still valid based on the run-time type of the data?
I was looking for some reference that points to this, but didn't find any.
Soluzione
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow