git.asbjorn.biz
/
swftools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
use xpdf's config files.
[swftools.git]
/
lib
/
mem.c
diff --git
a/lib/mem.c
b/lib/mem.c
index
98f4b1d
..
8e619dc
100644
(file)
--- a/
lib/mem.c
+++ b/
lib/mem.c
@@
-1,6
+1,8
@@
#include <memory.h>
#include <stdio.h>
#include <stdlib.h>
#include <memory.h>
#include <stdio.h>
#include <stdlib.h>
+#include <unistd.h>
+#include "mem.h"
// memory allocation
// memory allocation
@@
-11,6
+13,11
@@
void rfx_free(void*ptr)
free(ptr);
}
free(ptr);
}
+void start_debugger()
+{
+ //*(int*)0=0;
+}
+
void* rfx_alloc(int size)
{
void*ptr;
void* rfx_alloc(int size)
{
void*ptr;
@@
-23,7
+30,7
@@
void* rfx_alloc(int size)
ptr = malloc(size);
if(!ptr) {
fprintf(stderr, "FATAL: Out of memory (while trying to claim %d bytes)\n", size);
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;
exit(1);
}
return ptr;
@@
-45,7
+52,7
@@
void* rfx_realloc(void*data, int size)
if(!ptr) {
fprintf(stderr, "FATAL: Out of memory (while trying to claim %d bytes)\n", 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;
exit(1);
}
return ptr;
@@
-65,7
+72,7
@@
void* rfx_calloc(int size)
#endif
if(!ptr) {
fprintf(stderr, "FATAL: Out of memory (while trying to claim %d bytes)\n", size);
#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
exit(1);
}
#ifndef HAVE_CALLOC