1 /* ---------- dfalloc.c ---------- */
3 //#define WIN32_LEAN_AND_MEAN
6 #include "dflat32/dflat.h"
8 static void AllocationError(void)
10 static BOOL OnceIn
= FALSE
;
11 extern jmp_buf AllocError
;
12 extern BOOL AllocTesting
;
13 static char *ErrMsg
[] = {
20 DFRECT rc
= {30,11,47,13};
26 /* ------ close all windows ------ */
27 DfSendMessage(ApplicationWindow
, CLOSE_WINDOW
, 0, 0);
29 for (x
= 0; x
< 18; x
++)
31 for (y
= 0; y
< 3; y
++)
33 int c
= (255 & (*(*(ErrMsg
+y
)+x
))) | 0x7000;
34 PutVideoChar(x
+rc
.lf
, y
+rc
.tp
, c
);
38 StoreVideo(rc
, savbuf
);
40 longjmp(AllocError
, 1);
44 void *DFcalloc(size_t nitems
, size_t size
)
46 void *rtn
= calloc(nitems
, size
);
47 if (size
&& rtn
== NULL
)
52 void *DFmalloc(size_t size
)
54 void *rtn
= malloc(size
);
55 if (size
&& rtn
== NULL
)
60 void *DFrealloc(void *block
, size_t size
)
64 rtn
= realloc(block
, size
);
65 if (size
&& rtn
== NULL
)