Memory allocation for collections in .NET

前端 未结 2 2050
忘掉有多难
忘掉有多难 2021-01-19 15:33

This might be a dupe. I did not find enough information on this.

I was discussing memory allocation for collections in .Net. Where is the memory for elements alloca

2条回答
  •  野的像风
    2021-01-19 16:09

    The elements will be created on the heap. The only thing that lives on the stack is the pointer (reference) to the list (List<> is a reference type)

提交回复
热议问题