Horje
exception handling c# stack overflow Code Example
exception handling c# stack overflow
class Program
{
    static int n;
    static int topOfStack;
    const int stackSize = 1000000; // Default?

    // The func is 76 bytes, but we need space to unwind the exception.
    const int spaceRequired = 18*1024; 

    unsafe static void Main(string[] args)
    {
        int var;
        topOfStack = (int)&var;

        n=0;
        recurse();
    }

    unsafe static void recurse()
    {
        int remaining;
        remaining = stackSize - (topOfStack - (int)&remaining);
        if (remaining < spaceRequired)
            throw new Exception("Cheese");
        n++;
        recurse();
    }
}




Csharp

Related
how to disable vsync in monogame Code Example how to disable vsync in monogame Code Example
unity mouse click Code Example unity mouse click Code Example
nest elasticsearch date reange c# .net Code Example nest elasticsearch date reange c# .net Code Example
asp.net response.redirect new tab Code Example asp.net response.redirect new tab Code Example
on scene loaded Code Example on scene loaded Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9