(fix of commit
a825a2d)
Issue #206 (bdwgc).
* os_dep.c [USE_MUNMAP && USE_WINALLOC] (GC_remap): Cast result of
VirtualAlloc to ptr_t.
* win32_threads.c [!GC_NO_THREADS_DISCOVERY]
(GC_register_my_thread_inner): Cast the first argument of
InterlockedExchange() call to word* (instead of void*).
!= sizeof(mem_info))
ABORT("Weird VirtualQuery result");
alloc_len = (len < mem_info.RegionSize) ? len : mem_info.RegionSize;
- result = VirtualAlloc(start_addr, alloc_len, MEM_COMMIT,
- GC_pages_executable ? PAGE_EXECUTE_READWRITE :
- PAGE_READWRITE);
+ result = (ptr_t)VirtualAlloc(start_addr, alloc_len, MEM_COMMIT,
+ GC_pages_executable
+ ? PAGE_EXECUTE_READWRITE
+ : PAGE_READWRITE);
if (result != start_addr) {
if (GetLastError() == ERROR_NOT_ENOUGH_MEMORY ||
GetLastError() == ERROR_OUTOFMEMORY) {
/* variants. */
/* cast away volatile qualifier */
for (i = 0;
- InterlockedExchange((void*)&dll_thread_table[i].tm.in_use, 1) != 0;
+ InterlockedExchange((word*)&dll_thread_table[i].tm.in_use, 1) != 0;
i++) {
/* Compare-and-swap would make this cleaner, but that's not */
/* supported before Windows 98 and NT 4.0. In Windows 2000, */