Skip to content

Instantly share code, notes, and snippets.

@ArcticEcho
Last active August 29, 2015 14:02
Show Gist options
  • Save ArcticEcho/9525b8b98be7e241bd4d to your computer and use it in GitHub Desktop.
Save ArcticEcho/9525b8b98be7e241bd4d to your computer and use it in GitHub Desktop.
// Mark's method.
public unsafe static void TestMethod2()
{
var ptr = Marshal.AllocHGlobal(50000000);
try
{
float* x = (float*)ptr;
for (var ii = 0; ii < 1250000; ii++)
{
x[ii] = 32768;
}
}
finally
{
Marshal.FreeHGlobal(ptr);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment