mirror of
https://github.com/encounter/bdwgc.git
synced 2026-03-30 10:57:55 -07:00
Add missing type casts in remap and register_my_thread_inner
(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*).
This commit is contained in:
@@ -2603,9 +2603,10 @@ GC_INNER void GC_remap(ptr_t start, size_t bytes)
|
||||
!= 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) {
|
||||
|
||||
+1
-1
@@ -417,7 +417,7 @@ STATIC GC_thread GC_register_my_thread_inner(const struct GC_stack_base *sb,
|
||||
/* 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, */
|
||||
|
||||
Reference in New Issue
Block a user