summaryrefslogtreecommitdiff
path: root/rts/hooks/MallocFail.c
blob: 63343a770c55a3fdbb1bdc2ed70e2286b809f3be (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 */, char *msg)
{
    fprintf(stderr, "malloc: failed on request for %" FMT_Word " bytes; message: %s\n", request_size, msg);
}