Destroying a struct object in C#?

前端 未结 8 1386
长情又很酷
长情又很酷 2020-12-17 09:49

I am a bit confused about the fact that in C# only the reference types get garbage collected. That means GC picks only the reference types for memory de-allocation. So what

相关标签:
8条回答
  • 2020-12-17 10:26

    Would also like to add that stack is at a thread level, and heap is at application domain level.

    So, when a thread ends it would reclam the stack memory used by that specific thread.

    0 讨论(0)
  • 2020-12-17 10:33

    Value types are destroyed as soon as they go out of scope.

    0 讨论(0)
提交回复
热议问题