Valhalla Legends Forums Archive | General Programming | Did I just win?

AuthorMessageTime
iago
I broke msdev! :-)

[quote]C:\Documents and Settings\iago\My Documents\bak\My private projects\testprog\testprog.cpp(16) : fatal error C1001: INTERNAL COMPILER ERROR
 (compiler file 'E:\8168\vc98\p2\src\P2\x86\MDmisc.c', line 1244)
   Please choose the Technical Support command on the Visual C++
   Help menu, or open the Technical Support help file for more information
Error executing cl.exe.[/quote]

Here's the code (I know it's stupid, the memset is wrong etc.):
[code]#include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>
#include <memory.h>

#define TRUE  1
#define FALSE 0
#define NULL  0

int main(int argc, char* argv[])
{
     char TestArray[0x7FFFFFFF];
     memset(TestArray, 1, 1);

     system("pause");
     return 0;
}[/code]
February 19, 2003, 4:46 PM
iago
hmm.. by doing this:
[code]#include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>
#include <memory.h>

#define TRUE  1
#define FALSE 0
#define NULL  0

char TestArray[0x7FFFFFFF];

int main(int argc, char* argv[])
{
     
     memset(TestArray, 1, 1);

     system("pause");
     return 0;
}[/code]

It compiles, but I get the error "Could not execute: Bad executable format(Win32 error 193)" when it tries to run :-D
February 19, 2003, 4:50 PM
Zakath
Why the heck did you create such an enormous array? Just because you could? ;D
February 19, 2003, 6:54 PM
iago
I wanted to time how long it would take to access that many elements of an array, realistically (if I used a loop and, say, 10 elements, caching would screw it up).
February 19, 2003, 7:18 PM
Yoni
That's way over the maximum.
If you want to test access speed of a large block of memory, allocate like 100MB on the heap, not 2GB on the stack!
By making it global you probably confused the compiler enough for it to create an invalid file.
February 20, 2003, 2:52 PM
iago
Yes, but at the time I didn't stop and think, "Hey, this is WAAAY too big!"  :-)
February 20, 2003, 5:38 PM
Skywing
[quote]That's way over the maximum.
If you want to test access speed of a large block of memory, allocate like 100MB on the heap, not 2GB on the stack!
By making it global you probably confused the compiler enough for it to create an invalid file.[/quote]
I don't think you can typically find 2GB of contiguous unused address space :p

Besides, without large address aware set, you can only allocate 2GB maximum (total).
February 20, 2003, 8:35 PM

Search