#include "vbe.h"
#include "vga.h"
#include "util.h"
+#include "chkalloc.h"
#ifdef __WATCOMC__
#include <i86.h>
num_vmodes = 0;
max_modes = 256;
- if(!(vmodes = malloc(max_modes * sizeof *vmodes))) {
+ if(!(vmodes = chk_malloc(max_modes * sizeof *vmodes))) {
fprintf(stderr, "failed to allocate video modes list\n");
return -1;
}
if(num_vmodes >= max_modes) {
int newmax = max_modes ? (max_modes << 1) : 16;
- if(!(vmptr = realloc(vmodes, newmax * sizeof *vmodes))) {
+ if(!(vmptr = chk_realloc(vmodes, newmax * sizeof *vmodes))) {
fprintf(stderr, "failed to grow video mode list (%d)\n", newmax);
- free(vmodes);
+ chk_free(vmodes);
return -1;
}
vmodes = vmptr;
void cleanup_video(void)
{
- free(vmodes);
+ chk_free(vmodes);
}
struct video_mode *video_modes(void)
parm [ecx][eax][edx]
#endif /* __WATCOMC__ */
-
+
#define MSR_MTRRCAP 0xfe
#define MSR_MTRRDEFTYPE 0x2ff