diff options
author | Tomas Carnecky <tomas.carnecky@gmail.com> | 2016-05-19 21:03:32 +0200 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2016-05-19 21:34:44 +0200 |
commit | f0f351775dfb157889c42863b00a2b331bb422eb (patch) | |
tree | 92126e4ac4b5b80db1d52a9660c278ee4c45754a /rts/posix/OSMem.c | |
parent | 296b8f1baef2e6c88a418bbc5ac8b1ced111c745 (diff) | |
download | haskell-f0f351775dfb157889c42863b00a2b331bb422eb.tar.gz |
Remove use of caddr_t
> caddr_t is a legacy BSD type associated with some low level calls like
> mmap, and it should never be used in modern code. It was rejected by
> the POSIX standard. The standardized mmap uses void *.
(http://stackoverflow.com/questions/6381526/what-is-the-significance-of-
caddr-t-and-when-is-it-used)
Reviewers: austin, simonmar, rwbarton, bgamari, erikd
Reviewed By: rwbarton, bgamari, erikd
Subscribers: erikd, thomie
Differential Revision: https://phabricator.haskell.org/D2234
Diffstat (limited to 'rts/posix/OSMem.c')
-rw-r--r-- | rts/posix/OSMem.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/rts/posix/OSMem.c b/rts/posix/OSMem.c index a06f544874..4e6ecc2494 100644 --- a/rts/posix/OSMem.c +++ b/rts/posix/OSMem.c @@ -39,11 +39,11 @@ #include <sys/sysctl.h> #endif -static caddr_t next_request = 0; +static void *next_request = 0; void osMemInit(void) { - next_request = (caddr_t)RtsFlags.GcFlags.heapBase; + next_request = (void *)RtsFlags.GcFlags.heapBase; } /* ----------------------------------------------------------------------------- @@ -262,7 +262,7 @@ gen_map_mblocks (W_ size) void * osGetMBlocks(uint32_t n) { - caddr_t ret; + void *ret; W_ size = MBLOCK_SIZE * (W_)n; if (next_request == 0) { @@ -289,7 +289,7 @@ osGetMBlocks(uint32_t n) } // Next time, we'll try to allocate right after the block we just got. // ToDo: check that we haven't already grabbed the memory at next_request - next_request = ret + size; + next_request = (char *)ret + size; return ret; } |