Very well said and entirely true. This is pretty much exactly the problem with this little suggestion. It breaks the defined behavior, and does so in an unpredictable way. Means: when I use a struct, I normally do not know (exactly) how large it is.
In general, a 1Mb struct should not bea struct. Thomas Tomiczek THONA Software & Consulting Ltd. (Microsoft MVP C#/.NET) (CTO PowerNodes Ltd.) > -----Original Message----- > From: Unmoderated discussion of advanced .NET topics. > [mailto:[EMAIL PROTECTED] On Behalf Of > Srihari Angaluri > Sent: Samstag, 22. Mai 2004 04:53 > To: [EMAIL PROTECTED] > Subject: Re: [ADVANCED-DOTNET] Large structures > > Doesn't it alter the whole semantics of value types if the > implementation is allowed to do "hidden" optimizations like > these? For example, if the compiler passes the struct by > reference after a threshold size (let's say more than 1MB), > any modifications I make to the structure inside the method > will alter the actual parameter passed to the method, right? > That clearly is inconsitent with the semantics of value types.. > > Srihari > > =================================== > This list is hosted by DevelopMentor(r) 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