Will
Will

Reputation: 10431

ldloc or ldloca?

When does the compiler choose ldloc or ldloca? My guess is that it chooses ldloca for interfaces and valuetypes. But is that it? Does it choose it for other things too?

Upvotes: 5

Views: 1486

Answers (1)

SLaks
SLaks

Reputation: 887547

ldloca loads the address of a variable onto the stack.

It's used to pass variables as ref and out parameters.

Upvotes: 9

Related Questions