[Vm-dev] [OpenSmalltalk/opensmalltalk-vm] ea3d51: Handle both an ASCII (UTF8) and a WIDE (UTF16) ver...

GitHub noreply at github.com
Sun Dec 30 17:33:23 UTC 2018


  Branch: refs/heads/WIN64_UNICODE
  Home:   https://github.com/OpenSmalltalk/opensmalltalk-vm
  Commit: ea3d51e9dce14c9b081d3d4049fcb4223dc5b253
      https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/ea3d51e9dce14c9b081d3d4049fcb4223dc5b253
  Author: Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com>
  Date:   2018-12-30 (Sun, 30 Dec 2018)

  Changed paths:
    M platforms/win32/vm/sqWin32.h
    M platforms/win32/vm/sqWin32Main.c
    M platforms/win32/vm/sqWin32Prefs.c
    M platforms/win32/vm/sqWin32Service.c
    M platforms/win32/vm/sqWin32Window.c

  Log Message:
  -----------
  Handle both an ASCII (UTF8) and a WIDE (UTF16) version of image/vm name/path

Note:
the Microsoft windows API mostly uses the W version (for enabling internationalized image name/path)
the image uses UTF8 encoded bytes string for communication with the VM (this is best for compatibility with Unix/Mac)
The idea here is that the implementation maintains both versions of the UTF8 and UTF16 path/name

The appropriate macro returning a TCHAR * are also provided.
This is in order to support the generic version using TCHAR, which are normally used to ease transition to UNICODE.

Note about string length:
No effort has been made so far to support long path names for image and VM.
The path is limited to MAX_PATH in UTF16.
UTF8 can eventually consume more characters than UTF16 (not necessarily more bytes).
Thus, the ASCII version has been made longer (MAX_PATH_UTF8) in order to avoid an even more restrictive limit.


  Commit: 8bdd0b6afd5997ec3e29d10ce7602b21f6739e54
      https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/8bdd0b6afd5997ec3e29d10ce7602b21f6739e54
  Author: Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com>
  Date:   2018-12-30 (Sun, 30 Dec 2018)

  Changed paths:
    M platforms/win32/plugins/DropPlugin/sqWin32Drop.c

  Log Message:
  -----------
  DropPlugin: modernize OpenFile/_lwrite/_lclose API

OK, OK, they are compatible with 16 bits windows ;)
But these are not recommended any more especially if we want to go toward UNICODE paths everywhere.


  Commit: cb32e410a6ae4102a96d7110a562a25140d1be30
      https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/cb32e410a6ae4102a96d7110a562a25140d1be30
  Author: Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com>
  Date:   2018-12-30 (Sun, 30 Dec 2018)

  Changed paths:
    M platforms/win32/plugins/DropPlugin/sqWin32Drop.c

  Log Message:
  -----------
  Drop plugin: let tempPathName be Wide

This is for the generated temporary file $$squeak$$.bmp
The path to temporary directory could be non ASCII, so let's be more robust to UNICODE.


  Commit: 85e08830d9ee73100ebf6195a1da7a30ca811428
      https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/85e08830d9ee73100ebf6195a1da7a30ca811428
  Author: Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com>
  Date:   2018-12-30 (Sun, 30 Dec 2018)

  Changed paths:
    M platforms/win32/vm/sqWin32Service.c

  Log Message:
  -----------
  Fix 2 potential buffer overrun in sqWin32Service.c


  Commit: f6891456a8740e1b6ef2bcac6dc1527c2a31b7c6
      https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/f6891456a8740e1b6ef2bcac6dc1527c2a31b7c6
  Author: Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com>
  Date:   2018-12-30 (Sun, 30 Dec 2018)

  Changed paths:
    M platforms/win32/vm/sqWin32Main.c

  Log Message:
  -----------
  Setting fp flags _MCW_PC and _MCW_IC is not supported on ARM nor X64

See https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/control87-controlfp-control87-2?view=vs-2017
Setting these flags triggers an assertion failure when compiled with MSVC in debug mode

    Assertion failure (mask&~(_MCW_DN|_MCW_EM|_MCW_RC))==0


  Commit: 49eff31f03725185549bb736ad970818b37da612
      https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/49eff31f03725185549bb736ad970818b37da612
  Author: Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com>
  Date:   2018-12-30 (Sun, 30 Dec 2018)

  Changed paths:
    M platforms/win32/vm/sqWin32SpurAlloc.c

  Log Message:
  -----------
  The pageSize and pageMask are too short on WIN64

Due to this, roundUpToPage is truncating addresses > 2^32
With MSVC, minAddress is > 2^32, and it then takes ages to generate a VirtualAlloc > minAddress (several minutes).


Compare: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/5f71fce2f077...49eff31f0372
      **NOTE:** This service has been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/

      Functionality will be removed from GitHub.com on January 31st, 2019.


More information about the Vm-dev mailing list