summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik de Castro Lopo <erikd@mega-nerd.com>2015-11-01 10:19:15 +0100
committerBen Gamari <ben@smart-cactus.org>2015-11-01 10:19:16 +0100
commit184dfced1b07e1b178e98ae55f293187844b3105 (patch)
tree21dd6437eec91bdf00ea5ffec72998966aacd3cb
parentc8e866a190d4d5866bf364ee794db28b227a2e0e (diff)
downloadhaskell-184dfced1b07e1b178e98ae55f293187844b3105.tar.gz
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
-rw-r--r--rts/Linker.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/rts/Linker.c b/rts/Linker.c
index af3854ffc6..cd94561c5e 100644
--- a/rts/Linker.c
+++ b/rts/Linker.c
@@ -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);
}
}