summaryrefslogtreecommitdiff
path: root/rts/hooks/MallocFail.c
blob: 42606b6f347223ab31fce5d4284709e119b04dfc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* -----------------------------------------------------------------------------
 *
 * User-overridable RTS hooks.
 *
 * ---------------------------------------------------------------------------*/

#include "PosixSource.h"
#include "Rts.h"
#include "Hooks.h"

#include <stdio.h>

void
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);
}