.NET, get memory used to hold struct instance
<p>It's possible to determine memory usage (according to Jon Skeet's blog)
like this :</p>

<pre><code>public class Program
{
    private static void Main()
    {
        var before = GC.GetTotalMemory(true);

        var point = new Point(1, 0);

        var after = GC.GetTotalMemory(true);

        Console.WriteLine("Memory used: {0} bytes", after - before);
    }

    #region Nested type: Point

    private class Point
    {
        public int X;
        public int Y;

        public Point(int x, int y)
        {
            X = x;
            Y = y;
        }
    }

    #endregion
}
</code></pre>

<p>It prints <code>Memory used: 16 bytes</code> (I'm running x64 machine).
Consider we change Point declaration from class to struct. How then to determine memory used? Is is possible at all? I was unable to find anything about getting stack size in .NET</p>

<h2><strong>P.S</strong></h2>

<p>Yes, when changed to 'struct', Point instances will <em>often</em> be stored on Stack(not always), instead of Heap.Sorry for not posting it first time together with the question.</p>

<h2><strong>P.P.S</strong></h2>

<p>This situation has no practical usage at all(IMHO), It's just interesting for me whether it is possible to get Stack(short term storage) size. I was unable to find any info about it, so asked you, SO experts).</p>
