Off Topic: Stack vs. Heap
From: E. Robert Tisdale (E.Robert.Tisdale_at_jpl.nasa.gov)
Date: 10/09/03
- Next message: Jonathan Mcdougall: "Re: What is this - weird function definition"
- Previous message: SomeDumbGuy: "Re: The_Sage & void main()"
- In reply to: Kevin Grigorenko: "Stack vs. Heap"
- Next in thread: Kevin Grigorenko: "Re: Off Topic: Stack vs. Heap"
- Reply: Kevin Grigorenko: "Re: Off Topic: Stack vs. Heap"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 08 Oct 2003 20:48:39 -0700
Kevin Grigorenko wrote:
>
>
> I couldn't find an obvious answer to this in the FAQ. My basic question,
> is: Is there any difference in allocating on the heap versus the stack?
> If heap or stack implementation is not part of the standard, then just
> disregard this question. Here's some questions I'm confused about, and if
> you can add anything else, please do so!
>
> Is the stack limited for each program?
>
> On the other hand, is the heap basically limitless (except of course limited
> to the size of memory or page files)?
>
> If I've got something on the heap, as I understand it, another program can
> update any of my allocated storage without me knowing? Can this happen on
> the stack?
>
> Is there any performance difference in using variables on the stack versus
> on the heap?
>
> Are global and static variables on the stack?
>
> The reason I ask is I'm starting to get into C#, and it makes a big deal
> about allocating a lot of stuff on a garbage collected heap. I wouldn't
> want to start asking off-topic questions, so I'll just ask this: would a
> concept like this follow from the fact that heap storage is better to use
> for some reason rather than storage on the stack?
It depends upon your compiler.
Please tell us which compiler you are using
so that we can redirect to to the appropriate newsgroup.
- Next message: Jonathan Mcdougall: "Re: What is this - weird function definition"
- Previous message: SomeDumbGuy: "Re: The_Sage & void main()"
- In reply to: Kevin Grigorenko: "Stack vs. Heap"
- Next in thread: Kevin Grigorenko: "Re: Off Topic: Stack vs. Heap"
- Reply: Kevin Grigorenko: "Re: Off Topic: Stack vs. Heap"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|