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

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

#include <stdio.h>

void
MallocFailHook (lnat request_size /* in bytes */, char *msg)
{
    fprintf(stderr, "malloc: failed on request for %" FMT_SizeT " bytes; message: %s\n", request_size, msg);
}