Remove VirtualAlloc, VirtualFree & ZeroMemory. (PR #884)

. Allocation in Memory.cpp: keep VirtualAlloc of size=64KiB (alignment=64KiB) to ease debugging.
This commit is contained in:
Andrea
2020-12-10 21:08:15 +00:00
committed by GitHub
parent 86851d86e5
commit d2a34e1f91
22 changed files with 117 additions and 155 deletions
-19
View File
@@ -46,9 +46,6 @@ ImageError_e ImageOpen( const std::string & pszImageFilename,
std::string& strFilenameInZip,
const bool bExpectFloppy /*=true*/)
{
if (bExpectFloppy && sg_DiskImageHelper.GetWorkBuffer() == NULL)
return eIMAGE_ERROR_BAD_POINTER;
if (!(!pszImageFilename.empty() && ppImageInfo && pWriteProtected))
return eIMAGE_ERROR_BAD_POINTER;
@@ -114,22 +111,6 @@ BOOL ImageBoot(ImageInfo* const pImageInfo)
//===========================================================================
void ImageDestroy(void)
{
VirtualFree(sg_DiskImageHelper.GetWorkBuffer(), 0, MEM_RELEASE);
sg_DiskImageHelper.SetWorkBuffer(NULL);
}
//===========================================================================
void ImageInitialize(void)
{
LPBYTE pBuffer = (LPBYTE) VirtualAlloc(NULL, TRACK_DENIBBLIZED_SIZE*2, MEM_COMMIT, PAGE_READWRITE);
sg_DiskImageHelper.SetWorkBuffer(pBuffer);
}
//===========================================================================
void ImageReadTrack( ImageInfo* const pImageInfo,
float phase, // phase [0..79] +/- 0.5
LPBYTE pTrackImageBuffer,