[commit: ghc] master: RtsFlags: Make `mallocFailHook` const correct (584ade6)
git at git.haskell.org
git at git.haskell.org
Wed May 11 12:02:54 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/584ade67630f4e5c599c8422801e93f352b9a6df/ghc
>---------------------------------------------------------------
commit 584ade67630f4e5c599c8422801e93f352b9a6df
Author: Erik de Castro Lopo <erikd at mega-nerd.com>
Date: Mon May 2 21:20:28 2016 +1000
RtsFlags: Make `mallocFailHook` const correct
Test Plan: Validate
Reviewers: hvr, austin, bgamari, simonmar
Reviewed By: bgamari, simonmar
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2193
>---------------------------------------------------------------
584ade67630f4e5c599c8422801e93f352b9a6df
includes/RtsAPI.h | 2 +-
rts/hooks/Hooks.h | 2 +-
rts/hooks/MallocFail.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/includes/RtsAPI.h b/includes/RtsAPI.h
index 16b8486..a4a094f 100644
--- a/includes/RtsAPI.h
+++ b/includes/RtsAPI.h
@@ -90,7 +90,7 @@ typedef struct {
void (* outOfHeapHook) (W_ request_size, W_ heap_size);
// Called when malloc() fails, before exiting
- void (* mallocFailHook) (W_ request_size /* in bytes */, char *msg);
+ void (* mallocFailHook) (W_ request_size /* in bytes */, const char *msg);
// Called for every GC
void (* gcDoneHook) (unsigned int gen,
diff --git a/rts/hooks/Hooks.h b/rts/hooks/Hooks.h
index 35a6011..1383ccd 100644
--- a/rts/hooks/Hooks.h
+++ b/rts/hooks/Hooks.h
@@ -21,7 +21,7 @@ extern char *ghc_rts_opts;
extern void OnExitHook (void);
extern void StackOverflowHook (W_ stack_size);
extern void OutOfHeapHook (W_ request_size, W_ heap_size);
-extern void MallocFailHook (W_ request_size /* in bytes */, char *msg);
+extern void MallocFailHook (W_ request_size /* in bytes */, const char *msg);
extern void FlagDefaultsHook (void);
#include "EndPrivate.h"
diff --git a/rts/hooks/MallocFail.c b/rts/hooks/MallocFail.c
index 63343a7..42606b6 100644
--- a/rts/hooks/MallocFail.c
+++ b/rts/hooks/MallocFail.c
@@ -11,7 +11,7 @@
#include <stdio.h>
void
-MallocFailHook (W_ request_size /* in bytes */, char *msg)
+MallocFailHook (W_ request_size /* in bytes */, const char *msg)
{
fprintf(stderr, "malloc: failed on request for %" FMT_Word " bytes; message: %s\n", request_size, msg);
}
More information about the ghc-commits
mailing list