I'm not an expert... BUT.. I think I'm right..

If you're using C#, you can take advantage of boxing which takes a value
type and implicitly turns it into a reference type.  I dotn know the larger
performance/memory implications of this, so the experts will surely give the
best practices on this.

If you have the October MSDN Docs, you can see this URL about it

ms-help://MS.MSDNQTR.2003OCT.1033/csref/html/vclrfboxingconversionpg.htm

________
"One thing is for certain, though, about me -- and the world has learned
this -- when I say something, I mean it." - President George W. Bush

"And now [Democrats] claim to be outraged that in the months before 9-11,
Bush did not do everything Democrats opposed doing after 9-11. What a
surprise." - Ann Coulter

Vince --- AIM: pacelvi  MSN: this email address  Xbox: VinnyCHI




> -----Original Message-----
> From: Unmoderated discussion of advanced .NET topics.
> [mailto:[EMAIL PROTECTED] On Behalf Of Arlie Davis
> Sent: Sunday, 16 May, 2004 13:51
> To: [EMAIL PROTECTED]
> Subject: [ADVANCED-DOTNET] Large structures
>
> I have a few questions for the advanced CLR people here.  I
> haven't been able to find any satisfactory answers elsewhere.
>
> Consider value types / structures in CLR, and passing them as
> arguments to methods.  Does the MS CLR *always* copy the
> entire structure onto the stack?
> Or does it ever simply pass a pointer to the structure?
>
> I like value types.  However, structures of any significant
> size are just impractical, if they must always be copied.
> For example, in managed DirectX, nearly all of the matrix
> manipulation methods take "Matrix foo" as an argument, never
> "ref Matrix foo".  These matrices are 4x4 floats, which means
> that 64 bytes must be copied for every single matrix that is
> passed into a method.
>
> This seems like a big waste of time, compared to the same
> thing in C++, where you would simply always pass a pointer to
> the matrix.  Does the CLR actually pass an entire Matrix on
> the stack?  Or just a pointer?
>
> It seems like it would be within the specification /
> requirements of the CLR to allow a CLR implementation to do
> this, if it realizes that the method never alters the
> structure, only examines its fields.
>
> Any insight is appreciated.
>
> -- arlie
>
> ===================================
> This list is hosted by DevelopMentor.  http://www.develop.com
> Some .NET courses you may be interested in:
>
> NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles
> http://www.develop.com/courses/gaspdotnetls
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com
>
>

===================================
This list is hosted by DevelopMentor®  http://www.develop.com
Some .NET courses you may be interested in:

NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles
http://www.develop.com/courses/gaspdotnetls

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to