#include <memory.h>
#include <stdio.h>
#include <stdlib.h>
+#include <unistd.h>
#include "mem.h"
// memory allocation
free(ptr);
}
+void start_debugger()
+{
+ //*(int*)0=0;
+}
+
void* rfx_alloc(int size)
{
void*ptr;
ptr = malloc(size);
if(!ptr) {
fprintf(stderr, "FATAL: Out of memory (while trying to claim %d bytes)\n", size);
- /* TODO: we should send a signal, so that the debugger kicks in? */
+ start_debugger();
exit(1);
}
return ptr;
if(!ptr) {
fprintf(stderr, "FATAL: Out of memory (while trying to claim %d bytes)\n", size);
- /* TODO: we should send a signal, so that the debugger kicks in? */
+ start_debugger();
exit(1);
}
return ptr;
#endif
if(!ptr) {
fprintf(stderr, "FATAL: Out of memory (while trying to claim %d bytes)\n", size);
- /* TODO: we should send a signal, so that the debugger kicks in? */
+ start_debugger();
exit(1);
}
#ifndef HAVE_CALLOC