rb@cc.ic.ac.uk (Robin Becker) (03/22/91)
After much cursing and swearing I finally managed to get dj's gcc working on my PS/2 model 70. I found that I had a program called ld.exe on my path before the one required by gcc. I can now get the following to compile and run, but!!!!!! when it reaches the 4Meg allocation it bombs the machine and I get an IBM code 113 on the screen with the disk light continuously on. After switching off and on I find that my GCCTMP dir has a 0 byte paging file in it. Has any one got any ideas why this program should run OK if I remove the tmalloc(4000000); and is it anything to do with MCA versus AT bus? Thanks in advance Robin. BTW I have nothing using XMS unless there's shadowing going on in some way i.e. I have eliminated all diskcaches etc. #include <stdio.h> #include <malloc.h> static void tmalloc(int n) { char *ptr=malloc(n); register int i; if(ptr!=NULL){ printf("%10d bytes allocated\n", n ); for(i=0;i<n;i++) ptr[i] = 'b'; printf(" & assigned to\n"); } else printf("can't allocate %10d bytes\n", n); free(ptr); } main() { long count; unsigned size; char *ptr; float f; double d; printf("sizeof(long)=%u sizeof(unsigned)=%u\n", sizeof(long), sizeof(unsigned)); printf("sizeof(char)=%u sizeof(char *)=%u\n", sizeof(char), sizeof(char *)); printf("sizeof(float)=%u sizeof(double)=%u\n", sizeof(float), sizeof(double)); tmalloc(100000); tmalloc(1000000); tmalloc(2000000); tmalloc(3000000); tmalloc(4000000); /*this statement causes problems*/ }