Re: catching Runtime Stack Overflow Exception
From: Jon Skeet [C# MVP] (skeet_at_pobox.com)
Date: 09/02/04
- Previous message: assaf: "Re: catching Runtime Stack Overflow Exception"
- In reply to: assaf: "Re: catching Runtime Stack Overflow Exception"
- Next in thread: assaf: "Re: catching Runtime Stack Overflow Exception"
- Reply: assaf: "Re: catching Runtime Stack Overflow Exception"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 2 Sep 2004 21:27:07 +0100
assaf <assafwo@hotmail.com> wrote:
> there must be a way to prevent the application from crashing.
> the stack-overflowing thread is just a background graphics analysis
> operation.
> my system should be able to recover from it.
>
> here is its code that blows up the stack:
> RectangleF[] rects = this._Region..GetRegionScans(this._Matrix);
>
> as u can see, it is caused by a Region containing too many rectangles.
> since a RectangleF is a struct, a value type,
> the entire array is allocated on the stack.
No it's not. Arrays themselves are *always* reference types. The values
will be on the heap. It's more likely that GetRegionScans is recursing
too deeply.
-- Jon Skeet - <skeet@pobox.com> http://www.pobox.com/~skeet If replying to the group, please do not mail me too
- Previous message: assaf: "Re: catching Runtime Stack Overflow Exception"
- In reply to: assaf: "Re: catching Runtime Stack Overflow Exception"
- Next in thread: assaf: "Re: catching Runtime Stack Overflow Exception"
- Reply: assaf: "Re: catching Runtime Stack Overflow Exception"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|