diff options
| author | Simon Marlow <simonmar@microsoft.com> | 2006-08-30 14:02:52 +0000 |
|---|---|---|
| committer | Simon Marlow <simonmar@microsoft.com> | 2006-08-30 14:02:52 +0000 |
| commit | ab1e183aa7801f9260a9cbb6edbd553cf8249b25 (patch) | |
| tree | 7245d178055f0f05ce45c74d8eca56eea49af2b2 /rts/MBlock.c | |
| parent | ee4d9a57ab125607e3029a8c1d052114956811f5 (diff) | |
| download | haskell-ab1e183aa7801f9260a9cbb6edbd553cf8249b25.tar.gz | |
add sysErrorBelch() for reporting system call errors
Diffstat (limited to 'rts/MBlock.c')
| -rw-r--r-- | rts/MBlock.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/rts/MBlock.c b/rts/MBlock.c index 15a4d2300e..9058205716 100644 --- a/rts/MBlock.c +++ b/rts/MBlock.c @@ -337,9 +337,8 @@ allocNew(nat n) { if(rec->base==0) { stgFree((void*)rec); rec=0; - errorBelch( - "getMBlocks: VirtualAlloc MEM_RESERVE %d blocks failed with: %ld\n" - , n, GetLastError()); + sysErrorBelch( + "getMBlocks: VirtualAlloc MEM_RESERVE %d blocks failed", n); } else { if(allocs==0) { allocs=rec; @@ -451,7 +450,7 @@ commitBlocks(char* base, int size) { if(size_delta>size) size_delta=size; temp = VirtualAlloc(base, size_delta, MEM_COMMIT, PAGE_READWRITE); if(temp==0) { - errorBelch("getMBlocks: VirtualAlloc MEM_COMMIT failed: %ld\n", GetLastError()); + sysErrorBelch("getMBlocks: VirtualAlloc MEM_COMMIT failed"); stg_exit(EXIT_FAILURE); } size-=size_delta; @@ -515,7 +514,7 @@ freeAllMBlocks(void) it=allocs; for(; it!=0; ) { if(!VirtualFree((void*)it->base, 0, MEM_RELEASE)) { - errorBelch("freeAllMBlocks: VirtualFree MEM_RELEASE failed with %ld", GetLastError()); + sysErrorBelch("freeAllMBlocks: VirtualFree MEM_RELEASE failed"); stg_exit(EXIT_FAILURE); } next = it->next; |
