[Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Fix #484 [Win64]Cannot save and load image files with a heap whose size is more than 0xff ff ff ff (~4.1GB) (#485)

Jakob Reschke notifications at github.com
Sat Apr 11 19:46:53 UTC 2020


@j4yk commented on this pull request.



>    DWORD dwReallyWritten;
-  WriteFile((HANDLE)(h-1), (LPVOID) ptr, count*sz, &dwReallyWritten, NULL);
-  return (size_t) (dwReallyWritten / sz);
+  size_t totalToWrite = count * sz;
+  squeakFileOffsetType position;
+
+  position = sqImageFilePosition(h);
+  while (reallyWritten != totalToWrite) {
+    DWORD toWrite = (totalToWrite - reallyWritten) > (size_t) MAX_DWORD ? MAX_DWORD : totalToWrite - reallyWritten;
+    BOOL ret = WriteFile((HANDLE)(h - 1), (LPVOID)((sqInt)ptr + (sqInt) reallyWritten), toWrite, &dwReallyWritten, NULL);
+    reallyWritten += dwReallyWritten;
+
+    if (!ret | dwReallyWritten != toWrite) {

See above.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/485#pullrequestreview-391795361
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20200411/51d51b71/attachment.html>


More information about the Vm-dev mailing list