[commit: ghc] master: Linker: More uint64_t to uintptr_t fixes (184dfce)

git at git.haskell.org git at git.haskell.org
Sun Nov 1 09:47:05 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/184dfced1b07e1b178e98ae55f293187844b3105/ghc

>---------------------------------------------------------------

commit 184dfced1b07e1b178e98ae55f293187844b3105
Author: Erik de Castro Lopo <erikd at mega-nerd.com>
Date:   Sun Nov 1 10:19:15 2015 +0100

    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


>---------------------------------------------------------------

184dfced1b07e1b178e98ae55f293187844b3105
 rts/Linker.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/rts/Linker.c b/rts/Linker.c
index af3854f..cd94561 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);
    }
 }



More information about the ghc-commits mailing list