diff options
author | Ian Lynagh <igloo@earth.li> | 2010-10-29 20:41:58 +0000 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2010-10-29 20:41:58 +0000 |
commit | c53c1c16f47f331e3c1608f66e0b760d140105e6 (patch) | |
tree | d974d8e0383e03bf5bb134b4d405ee6c6c1c8c40 /rts/win32/OSMem.c | |
parent | 1c84e30e295e486c8e97e48aae6ae28060c15a85 (diff) | |
download | haskell-c53c1c16f47f331e3c1608f66e0b760d140105e6.tar.gz |
Whitespace only, in rts/win32/OSMem.c
Diffstat (limited to 'rts/win32/OSMem.c')
-rw-r--r-- | rts/win32/OSMem.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/rts/win32/OSMem.c b/rts/win32/OSMem.c index 44286d2562..99c8b111b2 100644 --- a/rts/win32/OSMem.c +++ b/rts/win32/OSMem.c @@ -45,7 +45,7 @@ allocNew(nat n) { alloc_rec* rec; rec = (alloc_rec*)stgMallocBytes(sizeof(alloc_rec),"getMBlocks: allocNew"); rec->size = (n+1)*MBLOCK_SIZE; - rec->base = + rec->base = VirtualAlloc(NULL, rec->size, MEM_RESERVE, PAGE_READWRITE); if(rec->base==0) { stgFree((void*)rec); @@ -58,8 +58,8 @@ allocNew(nat n) { "getMBlocks: VirtualAlloc MEM_RESERVE %d blocks failed", n); } } else { - alloc_rec temp; - temp.base=0; temp.size=0; temp.next=allocs; + alloc_rec temp; + temp.base=0; temp.size=0; temp.next=allocs; alloc_rec* it; it=&temp; @@ -67,7 +67,7 @@ allocNew(nat n) { rec->next=it->next; it->next=rec; - allocs=temp.next; + allocs=temp.next; } return rec; } @@ -168,8 +168,8 @@ commitBlocks(char* base, int size) { temp = VirtualAlloc(base, size_delta, MEM_COMMIT, PAGE_READWRITE); if(temp==0) { sysErrorBelch("getMBlocks: VirtualAlloc MEM_COMMIT failed"); - stg_exit(EXIT_FAILURE); - } + stg_exit(EXIT_FAILURE); + } size-=size_delta; base+=size_delta; } @@ -183,12 +183,12 @@ osGetMBlocks(nat n) { alloc_rec* alloc; alloc = allocNew(n); /* We already belch in allocNew if it fails */ - if (alloc == 0) { - stg_exit(EXIT_FAILURE); - } else { + if (alloc == 0) { + stg_exit(EXIT_FAILURE); + } else { insertFree(alloc->base, alloc->size); ret = findFreeBlocks(n); - } + } } if(ret!=0) { @@ -261,7 +261,7 @@ osFreeAllMBlocks(void) for(; it!=0; ) { if(!VirtualFree((void*)it->base, 0, MEM_RELEASE)) { sysErrorBelch("freeAllMBlocks: VirtualFree MEM_RELEASE failed"); - stg_exit(EXIT_FAILURE); + stg_exit(EXIT_FAILURE); } next = it->next; stgFree(it); @@ -274,23 +274,23 @@ lnat getPageSize (void) { static lnat pagesize = 0; if (pagesize) { - return pagesize; + return pagesize; } else { - SYSTEM_INFO sSysInfo; - GetSystemInfo(&sSysInfo); - pagesize = sSysInfo.dwPageSize; - return pagesize; + SYSTEM_INFO sSysInfo; + GetSystemInfo(&sSysInfo); + pagesize = sSysInfo.dwPageSize; + return pagesize; } } void setExecutable (void *p, lnat len, rtsBool exec) { DWORD dwOldProtect = 0; - if (VirtualProtect (p, len, - exec ? PAGE_EXECUTE_READWRITE : PAGE_READWRITE, - &dwOldProtect) == 0) + if (VirtualProtect (p, len, + exec ? PAGE_EXECUTE_READWRITE : PAGE_READWRITE, + &dwOldProtect) == 0) { - sysErrorBelch("setExecutable: failed to protect 0x%p; old protection: %lu\n", + sysErrorBelch("setExecutable: failed to protect 0x%p; old protection: %lu\n", p, (unsigned long)dwOldProtect); stg_exit(EXIT_FAILURE); } |