X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=Client%20Applications%2Frcracki_mt%2FMemoryPool.cpp;h=77a4eabbd5aacca9bdd22776718c896ad7952084;hb=86bbf0fd5ba4e07d3279b4179fd8fc808198eaae;hp=f48961d895dfdceb07a28843378ebe5f023ee405;hpb=ce75ca839a9cd1863ea13636ffebf7ee1dcc4267;p=freerainbowtables diff --git a/Client Applications/rcracki_mt/MemoryPool.cpp b/Client Applications/rcracki_mt/MemoryPool.cpp index f48961d..77a4eab 100644 --- a/Client Applications/rcracki_mt/MemoryPool.cpp +++ b/Client Applications/rcracki_mt/MemoryPool.cpp @@ -8,7 +8,7 @@ * Copyright 2009, 2010 James Nobis * Copyright 2010 uroskn * - * This file is part of racrcki_mt. + * This file is part of rcracki_mt. * * rcracki_mt is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -33,11 +33,15 @@ CMemoryPool::CMemoryPool(unsigned int bytesSaved, bool bDebug, uint64 maxMem) m_nMemSize = 0; debug = bDebug; - uint64 nAvailPhys = GetAvailPhysMemorySize(); + unsigned long nAvailPhys = GetAvailPhysMemorySize(); if ( debug ) { - printf( "Debug: nAvailPhys: %llu\n", nAvailPhys ); + #if defined(_WIN32) && !defined(__GNUC__) + printf( "Debug: nAvailPhys: %I64u\n", nAvailPhys ); + #else + printf( "Debug: nAvailPhys: %lu\n", nAvailPhys ); + #endif printf( "Debug: bytesSaved: %d\n", bytesSaved ); } @@ -87,8 +91,8 @@ unsigned char* CMemoryPool::Allocate(unsigned int nFileLen, uint64& nAllocatedSi m_pMem = new (nothrow) unsigned char[nTargetSize]; while (m_pMem == NULL && nTargetSize >= 32 * 1024 * 1024 ) { - nTargetSize -= 16 * 1024 * 1024; - m_pMem = new (nothrow) unsigned char[nTargetSize]; + nTargetSize -= 16 * 1024 * 1024; + m_pMem = new (nothrow) unsigned char[nTargetSize]; } if (m_pMem != NULL)