Valhalla Legends Archive

Programming => General Programming => Topic started by: iago on February 19, 2003, 10:46 AM

Title: Did I just win?
Post by: iago on February 19, 2003, 10:46 AM
I broke msdev! :-)

QuoteC:\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.

Here's the code (I know it's stupid, the memset is wrong etc.):
#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;
}
Title: Re: Did I just win?
Post by: iago on February 19, 2003, 10:50 AM
hmm.. by doing this:
#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;
}

It compiles, but I get the error "Could not execute: Bad executable format(Win32 error 193)" when it tries to run :-D
Title: Re: Did I just win?
Post by: Zakath on February 19, 2003, 12:54 PM
Why the heck did you create such an enormous array? Just because you could? ;D
Title: Re: Did I just win?
Post by: iago on February 19, 2003, 01:18 PM
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).
Title: Re: Did I just win?
Post by: Yoni on February 20, 2003, 08:52 AM
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.
Title: Re: Did I just win?
Post by: iago on February 20, 2003, 11:38 AM
Yes, but at the time I didn't stop and think, "Hey, this is WAAAY too big!"  :-)
Title: Re: Did I just win?
Post by: Skywing on February 20, 2003, 02:35 PM
QuoteThat'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.
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).