chroot. (Use "SBCL_ARCH=x86 sh make.sh" to build.)
* enhancement: added new toplevel options --quit and --non-interactive
(lp#822712).
+ * enhancement: the Windows port of SBCL now builds and runs on Wine
+ (thanks to Anton Kovalenko).
* optimization: unsigned integer divisions by a constant are implemented
using multiplication (affects CEILING, FLOOR, TRUNCATE, MOD, and REM.)
* optimization: improved type-derivation for LOAD-TIME-VALUE.
return 0;
}
- if ((mem_info.State == MEM_RESERVE) && (mem_info.RegionSize >=len)) return addr;
+ if ((mem_info.State == MEM_RESERVE) && (mem_info.RegionSize >=len)) {
+ /* It would be correct to return here. However, support for Wine
+ * is beneficial, and Wine has a strange behavior in this
+ * department. It reports all memory below KERNEL32.DLL as
+ * reserved, but disallows MEM_COMMIT.
+ *
+ * Let's work around it: reserve the region we need for a second
+ * time. The second reservation is documented to fail on normal NT
+ * family, but it will succeed on Wine if this region is
+ * actually free.
+ */
+ VirtualAlloc(addr, len, MEM_RESERVE, PAGE_EXECUTE_READWRITE);
+ /* If it is wine, the second call has succeded, and now the region
+ * is really reserved. */
+ return addr;
+ }
if (mem_info.State == MEM_RESERVE) {
fprintf(stderr, "validation of reserved space too short.\n");