Is there anything special you need to do to get large chunks of memory in Windows or Visual Studio?

This is the challenge I am making.

table  = (int *) malloc(sizeof(int) * (C+1) * (N+1));

C+1*N+1 is 657 562 500

But this call returns NULLfor me when executed on Windows (indicating that it cannot allocate this space).
(it works great with fewer numbers, and also works great with larger numbers than it does on my Linux box)

The program actually does nothing before that.

When I look at the Task Manager, it shows 28.1 GB of available memory.

So, I am wondering if there is something that I can set in Visual Studio, for example, a compiler flag or something that will allow me to capture large chunks of memory?

If my math is correct, I find that I ask for about 1.22 GB.

Appreciate any help

: -, 64- . - , c 64- ? Win32 - .

+4
2

, 32- .

, 32- 2 . , 4 x 650M 2,6 .

64- .

- , . .

+6

, , 64- Visual Studio. VS 2010, 2012 , , 2010 2012 .

IDE :

Build / Configuration Manager / Active Solution Platform / New... 

, . 64- .

enter image description here

+1

Source: https://habr.com/ru/post/1524633/


All Articles