Rewinder - small fix to memory allocation limit.

This commit is contained in:
jdpurcell 2015-01-19 19:48:04 +00:00
parent 2e737e66be
commit 0ca93f35ba
1 changed files with 4 additions and 3 deletions

View File

@ -221,10 +221,11 @@ namespace BizHawk.Client.Common
{
if (allocate)
{
if (size > Int32.MaxValue)
const int MaxByteArraySize = 0x7FFFFFC7;
if (size > MaxByteArraySize)
{
// I think we need .NET 4.5+ on x64 to allocate > 2GB
size = Int32.MaxValue;
// .NET won't let us allocate more than this in one array
size = MaxByteArraySize;
}
if (_overrideMemoryLimit != null)