diff options
author | Erik de Castro Lopo <erikd@mega-nerd.com> | 2016-05-02 06:37:14 +1000 |
---|---|---|
committer | Erik de Castro Lopo <erikd@mega-nerd.com> | 2016-05-05 08:29:27 +1000 |
commit | db9de7eb3e91820024f673bfdb6fb8064cfed20d (patch) | |
tree | 5e1c3ef0b6dee7f40fedbc118ba36cfe6ffdd1ee /rts/win32 | |
parent | ad4392c142696d5092533480a82ed65322e9d413 (diff) | |
download | haskell-db9de7eb3e91820024f673bfdb6fb8064cfed20d.tar.gz |
rts: Replace `nat` with `uint32_t`
The `nat` type was an alias for `unsigned int` with a comment saying
it was at least 32 bits. We keep the typedef in case client code is
using it but mark it as deprecated.
Test Plan: Validated on Linux, OS X and Windows
Reviewers: simonmar, austin, thomie, hvr, bgamari, hsyl20
Differential Revision: https://phabricator.haskell.org/D2166
Diffstat (limited to 'rts/win32')
-rw-r--r-- | rts/win32/AwaitEvent.c | 2 | ||||
-rw-r--r-- | rts/win32/OSMem.c | 8 | ||||
-rw-r--r-- | rts/win32/OSThreads.c | 10 | ||||
-rw-r--r-- | rts/win32/ThrIOManager.c | 2 |
4 files changed, 11 insertions, 11 deletions
diff --git a/rts/win32/AwaitEvent.c b/rts/win32/AwaitEvent.c index feae4c86ed..51581025e1 100644 --- a/rts/win32/AwaitEvent.c +++ b/rts/win32/AwaitEvent.c @@ -22,7 +22,7 @@ // Used to avoid calling abandonRequestWait() if we don't need to. // Protected by sched_mutex. -static nat workerWaitingForRequests = 0; +static uint32_t workerWaitingForRequests = 0; void awaitEvent(rtsBool wait) diff --git a/rts/win32/OSMem.c b/rts/win32/OSMem.c index 0009a4ec9d..65791b69d1 100644 --- a/rts/win32/OSMem.c +++ b/rts/win32/OSMem.c @@ -48,7 +48,7 @@ osMemInit(void) static alloc_rec* -allocNew(nat n) { +allocNew(uint32_t n) { alloc_rec* rec; rec = (alloc_rec*)stgMallocBytes(sizeof(alloc_rec),"getMBlocks: allocNew"); rec->size = ((W_)n+1)*MBLOCK_SIZE; @@ -117,7 +117,7 @@ insertFree(char* alloc_base, W_ alloc_size) { static void* -findFreeBlocks(nat n) { +findFreeBlocks(uint32_t n) { void* ret=0; block_rec* it; block_rec temp; @@ -186,7 +186,7 @@ commitBlocks(char* base, W_ size) { } void * -osGetMBlocks(nat n) { +osGetMBlocks(uint32_t n) { void* ret; ret = findFreeBlocks(n); if(ret==0) { @@ -246,7 +246,7 @@ static void decommitBlocks(char *addr, W_ nBytes) } } -void osFreeMBlocks(char *addr, nat n) +void osFreeMBlocks(char *addr, uint32_t n) { W_ nBytes = (W_)n * MBLOCK_SIZE; diff --git a/rts/win32/OSThreads.c b/rts/win32/OSThreads.c index 0c256127e5..7a51ec5191 100644 --- a/rts/win32/OSThreads.c +++ b/rts/win32/OSThreads.c @@ -242,10 +242,10 @@ forkOS_createThread ( HsStablePtr entry ) (unsigned*)&pId) == 0); } -nat +uint32_t getNumberOfProcessors (void) { - static nat nproc = 0; + static uint32_t nproc = 0; if (nproc == 0) { SYSTEM_INFO si; @@ -257,11 +257,11 @@ getNumberOfProcessors (void) } void -setThreadAffinity (nat n, nat m) // cap N of M +setThreadAffinity (uint32_t n, uint32_t m) // cap N of M { HANDLE hThread; DWORD_PTR mask, r; // 64-bit win is required to handle more than 32 procs - nat nproc, i; + uint32_t nproc, i; hThread = GetCurrentThread(); @@ -308,7 +308,7 @@ forkOS_createThread ( HsStablePtr entry STG_UNUSED ) return -1; } -nat getNumberOfProcessors (void) +uint32_t getNumberOfProcessors (void) { return 1; } diff --git a/rts/win32/ThrIOManager.c b/rts/win32/ThrIOManager.c index 3f50e53817..0fb5912024 100644 --- a/rts/win32/ThrIOManager.c +++ b/rts/win32/ThrIOManager.c @@ -26,7 +26,7 @@ static HANDLE io_manager_event = INVALID_HANDLE_VALUE; #define EVENT_BUFSIZ 256 Mutex event_buf_mutex; StgWord32 event_buf[EVENT_BUFSIZ]; -nat next_event; +uint32_t next_event; #endif |