1 /* ---------- dfalloc.c ----------
2 * This seems simple enough, if a AllocationError occors
3 * then try to handle it in a somewhat clean fashion.
5 * Dont ask I didnt write it. - sedwards
8 /* #define WIN32_LEAN_AND_MEAN Removed for ROS */
12 #include <dflat32/dflat.h>
14 static void AllocationError(void)
16 static BOOL OnceIn
= FALSE
;
17 extern jmp_buf AllocError
;
18 extern BOOL AllocTesting
;
19 static char *ErrMsg
[] = {
26 DFRECT rc
= {30,11,47,13};
32 /* ------ close all windows ------ */
33 DfSendMessage(ApplicationWindow
, CLOSE_WINDOW
, 0, 0);
35 for (x
= 0; x
< 18; x
++)
37 for (y
= 0; y
< 3; y
++)
39 int c
= (255 & (*(*(ErrMsg
+y
)+x
))) | 0x7000;
40 PutVideoChar(x
+rc
.lf
, y
+rc
.tp
, c
);
44 StoreVideo(rc
, savbuf
);
46 longjmp(AllocError
, 1);
50 void *DFcalloc(size_t nitems
, size_t size
)
52 void *rtn
= calloc(nitems
, size
);
53 if (size
&& rtn
== NULL
)
58 void *DFmalloc(size_t size
)
60 void *rtn
= malloc(size
);
61 if (size
&& rtn
== NULL
)
66 void *DFrealloc(void *block
, size_t size
)
70 rtn
= realloc(block
, size
);
71 if (size
&& rtn
== NULL
)