Heap & Stack Question
- From: nicolas.hilaire@xxxxxxxxxxxx
- Date: 29 Dec 2005 08:03:21 -0800
Hi all,
following this link,
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/_core_.2f.HEAP_link.asp,
the msdn tells that the default heap size is 1 MB and can be set with
/HEAP:reserve[,commit] linker option.
On the same way, we can set the stack with /STACK:reserve[,commit],
which is 1MB too.
But, if i do an allocation : for example
int * t = new int[5000000];
this should be localized in the heap ? like if i use HeapAlloc (or
GlobalAlloc/LocalAlloc) ? But it's larger than 1MB ... Where is it
wrong ?
I thought on the same way, that something like this
int t[5000000];
is localized on the stack, how ? is-it right ?
And what about VirtualAlloc ?
I'm really not clear with that, i hope someone can makes me this
clearer
Thanks in advance
Nicolas H.
.
- Follow-Ups:
- Re: Heap & Stack Question
- From: Oleg Starodumov
- Re: Heap & Stack Question
- Prev by Date: Write to Registry
- Next by Date: Re: Write to Registry
- Previous by thread: Write to Registry
- Next by thread: Re: Heap & Stack Question
- Index(es):
Relevant Pages
|