Commit 184dfced authored by Erik de Castro Lopo's avatar Erik de Castro Lopo Committed by Ben Gamari

Linker: More uint64_t to uintptr_t fixes

Need to use `uintptr_t` on PowerPC and possibly other 32 bit
architectures.

Test Plan: Validate on x86_64 and powerpc Linux

Reviewers: austin, hvr, bgamari

Reviewed By: bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1412
parent c8e866a1
......@@ -1300,7 +1300,7 @@ m32_alloc(m32_allocator m32, unsigned int size,
void * addr = (char*)m32->pages[i].base_addr + alsize;
m32->pages[i].current_size = alsize + size;
// increment the counter atomically
__sync_fetch_and_add((uint64_t*)m32->pages[i].base_addr, 1);
__sync_fetch_and_add((uintptr_t*)m32->pages[i].base_addr, 1);
return addr;
}
// most filled?
......@@ -1329,7 +1329,7 @@ m32_alloc(m32_allocator m32, unsigned int size,
m32->pages[empty].current_size = size+ROUND_UP(8,alignment);
// Initialize the counter:
// 1 for the allocator + 1 for the returned allocated memory
*((uint64_t*)addr) = 2;
*((uintptr_t*)addr) = 2;
return (char*)addr + ROUND_UP(8,alignment);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment