This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Stack Versus Heap


Michael.Schmidt@L-3com.com writes:

> I've read that allocating objects on the stack is faster than on the
> heap.  What about deletion?  Is deleting an object from the heap a lot
> less efficient?  Are the performance differences so negligible that they
> won't matter?
>
> Are there any papers or articles that address the stack and heap
> implementations?

This question would be more appropriate for a general C language
mailing list.  The mailing list gcc@gcc.gnu.org is for people working
on developing the gcc compiler.

Please direct any followups elsewhere.  Thanks.

Yes, allocating objects on the stack is faster.  Deleting them is also
faster.  The performance differences are not negligible.  I don't know
of any papers; it's just obvious if you look at the generated code.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]