diff options
author | Björn-Egil Dahlberg <[email protected]> | 2013-03-04 18:06:12 +0100 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2013-03-04 18:06:12 +0100 |
commit | d0e0ce2aa23f036675288735a43fc6581d79c95c (patch) | |
tree | bb6420318aebf8c4611fbc39ccc299cd48c30117 /erts/emulator/sys/common/erl_mseg.c | |
parent | 41e849eecd06ebb1472ddfb369243f0b337e0bd7 (diff) | |
download | otp-d0e0ce2aa23f036675288735a43fc6581d79c95c.tar.gz otp-d0e0ce2aa23f036675288735a43fc6581d79c95c.tar.bz2 otp-d0e0ce2aa23f036675288735a43fc6581d79c95c.zip |
erts: Fix void * arithmetic
Diffstat (limited to 'erts/emulator/sys/common/erl_mseg.c')
-rw-r--r-- | erts/emulator/sys/common/erl_mseg.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/erts/emulator/sys/common/erl_mseg.c b/erts/emulator/sys/common/erl_mseg.c index bd8ba82a5f..f5a29fcb95 100644 --- a/erts/emulator/sys/common/erl_mseg.c +++ b/erts/emulator/sys/common/erl_mseg.c @@ -350,7 +350,7 @@ schedule_cache_check(ErtsMsegAllctr_t *ma) { static ERTS_INLINE void * mmap_align(ErtsMsegAllctr_t *ma, void *addr, size_t length, int prot, int flags, int fd, off_t offset) { - void *p, *q; + char *p, *q; UWord d; p = mmap(addr, length, prot, flags, fd, offset); @@ -366,14 +366,14 @@ mmap_align(ErtsMsegAllctr_t *ma, void *addr, size_t length, int prot, int flags, if ((p = mmap(addr, length + MSEG_ALIGNED_SIZE, prot, flags, fd, offset)) == MAP_FAILED) return MAP_FAILED; - q = (void *)ALIGNED_CEILING(p); - d = q - p; + q = (void *)ALIGNED_CEILING((char *)p); + d = (UWord)(q - p); if (d > 0) munmap(p, d); if (MSEG_ALIGNED_SIZE - d > 0) - munmap((void *) (q + length), MSEG_ALIGNED_SIZE - d); + munmap((void *)(q + length), MSEG_ALIGNED_SIZE - d); return q; } @@ -708,7 +708,7 @@ static ERTS_INLINE void *cache_get_segment(MemKind *mk, Uint *size_p, Uint flags /* Use current cache placement for remaining segment space */ - best->seg = seg + size; + best->seg = ((char *)seg) + size; best->size = csize - size; ASSERT((size % GET_PAGE_SIZE) == 0); |