P
P
Pragma Games2021-09-14 19:11:25
C++ / C#
Pragma Games, 2021-09-14 19:11:25

How much does an object reference weigh?

Imagine a situation in which we created an object A a = new A(), and then this object was passed to some method b.info(a). How much does a reference to object a weigh? And what does the weight of the link depend on (on the architecture of the operating system, the weight of the object itself, etc.)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
freeExec, 2021-09-14
@PragmaGames

For what purpose are you interested?
The link itself (it's just the memory address where the beginning of the object is located) takes 32-bits or 64-bits, depending on the OS. But I don't see any practical benefit from this knowledge in the context of c#.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question