Thank you Chris.

I think the sum total sizes of the "references" for all the objects in the
struct and the additional parameters on the method was greater than 256
bytes.
I got word back from MS on this issue:

"...generally speaking, when the total size of the arguments passed to a
callee function is larger than 256 bytes, JIT will make the caller function
partially interruptible.  In a partially interruptible code, not every
location in the code is a GC safe point.  Therefore, it might be unsafe to
evaluate expression at certain locations.  When this happens you get [the
error message]."

So it seems that even since the fields were references, the sum of all them
exceeded the 256 byte *limit* for the debugger.


On 6/21/07, Chris Anderson <[EMAIL PROTECTED]> wrote:

I've been trying to look for a cite, but can only tell you that I was
told by a instructor (albeit a SQL Server 2005 one) anything bigger than
about 150 bytes was too big (remembering that a reference to a
DataTable, etc was only the size of the *reference* and not the size of
the data table contents, etc), but really it depends on usage IMO.

One cite I *can* find is that "Unless you need reference type semantics,
a class that is smaller than 16 bytes may be more efficiently handled by
the system as a struct"

http://msdn2.microsoft.com/en-us/library/ah19swz4(vs.71).aspx

Not that that helps of course :-)



> -----Original Message-----
> From: Discussion of advanced .NET topics. [mailto:ADVANCED-
> [EMAIL PROTECTED] On Behalf Of Mike Andrews
> Sent: 22 June 2007 00:01
> To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
> Subject: Re: [ADVANCED-DOTNET] PRB: Cannot evaluate expression because
> a thread is stopped at a point where garbage collection is
> impossible...
>
> Very true.
> I was just curious.
> I'm generally more sparing on my use of structs.
>
> Nevertheless, I still want to know the maximum size of a struct or if
> there
> is no size limit, the optimal size of a struct.
>
>
> On 6/21/07, Chris Anderson <[EMAIL PROTECTED]> wrote:
> >
> > > Does anyone know the maximum size of a struct that can be used in
> the
> > > Framework without having these issues?
> >
> > The general rule of thumb is : If you're worrying about the maximum
> size
> > of a struct, it's already too big!
> >
> > Structs were designed to be used for small lightweight data types
> (like
> > Point, Rectangle, etc)
> >
> > ===================================
> > This list is hosted by DevelopMentor(r)  http://www.develop.com
> >
> > View archives and manage your subscription(s) at
> > http://discuss.develop.com
> >
>
> ===================================
> This list is hosted by DevelopMentor(r)  http://www.develop.com
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com
>

===================================
This list is hosted by DevelopMentor(r)  http://www.develop.com

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


===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

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

Reply via email to