Commit 584ade67 authored by Erik de Castro Lopo's avatar Erik de Castro Lopo

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
parent 8669c48d
......@@ -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,
......
......@@ -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"
......
......@@ -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);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment