[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)

Fabio Niephaus lists at fniephaus.com
Sat Apr 11 20:13:06 UTC 2020


@Jakob: Eliot seems to have merged this without incorporating your
feedback. Could you please open another PR with your suggestions?

Thanks,
Fabio

On Sat, 11 Apr 2020 at 9:46 pm, Jakob Reschke <notifications at github.com>
wrote:

>
>
> *@j4yk* commented on this pull request.
> ------------------------------
>
> In platforms/win32/plugins/FilePlugin/sqWin32FilePrims.c
> <https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/485#discussion_r407103373>
> :
>
> >    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, view it on GitHub
> <https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/485#pullrequestreview-391795361>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AIJPEWYSLSBS2AMBET6YZLTRMDCK3ANCNFSM4MGDV3UQ>
> .
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20200411/9d4d55bf/attachment.html>


More information about the Vm-dev mailing list