Re: Struct inside class

Tech-Archive recommends: Fix windows errors by optimizing your registry



Barry Kelly wrote:

The memory for the struct s in this example is part of (i.e. fully
contained within) the heap-allocated object myClass.

OK, I think the same. BUT! In other words myClass.s.i1 is already in
heap, yes? Now - what is boxing? Boxing is creating special packed
version of value-type in heap. In our case i1 ALREADY in heap. So...
object o = myClass.s.i1; //_not_ a boxing here?
???
.



Relevant Pages

  • Re: Struct inside class
    ... In this case, boxing must be done. ... that the compiler will have to generate addition calls into the memory ... so it's stored on the heap. ... If GC_ALLOCATE can't allocate the requested ...
    (microsoft.public.dotnet.framework)
  • Boxing effect on struct methods
    ... Couple of questions relating to boxing. ... the heap so that the system can treat a value type like a reference type. ... If I add custom instance method on a struct, will it box that type each ...
    (microsoft.public.dotnet.languages.csharp)
  • Boxing questions relating to struct methods
    ... Couple of questions relating to boxing. ... the heap so that the system can treat a value type like a reference type. ... If I add custom instance method on a struct, will it box that type each ...
    (microsoft.public.dotnet.framework)
  • Re: Double not a class but struct
    ... > should be allocated on stack or heap (Reference types). ... Value types can live on the heap too, ... which is termed as Boxing and Unboxing concepts. ... Yes, this is boxing. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Struct inside class
    ... Boxing is creating special packed ... version of value-type in heap. ... you are storing a copy of the value of the myClass.s.il variable. ...
    (microsoft.public.dotnet.framework)