This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Fwd: Heapless C/C++
- From: Shiv Shankar Dayal <shivshankar dot dayal at gmail dot com>
- To: gcc at gcc dot gnu dot org
- Date: Sat, 8 Oct 2011 15:13:23 +0530
- Subject: Fwd: Heapless C/C++
- References: <1318065056.50780.androidMobile@web125414.mail.ne1.yahoo.com> <CALJ_jGSt5gKj9+zAef6FUn61RBRDLQrQ_5H6RRt9HtRsR3S_Vg@mail.gmail.com> <CALJ_jGT+-t3emucsSTpNzB0x826EeWUcnZ0FUwxDUJErR36u3g@mail.gmail.com>
Hi,
I am sorry. I just hit reply.
---------- Forwarded message ----------
From: Shiv Shankar Dayal <shivshankar.dayal@gmail.com>
Date: Sat, Oct 8, 2011 at 2:46 PM
Subject: Re: Heapless C/C++
To: foxmuldrster@yahoo.com
On Sat, Oct 8, 2011 at 2:40 PM, Rick Hodgin <foxmuldrster@yahoo.com> wrote:
>
> Shiv,
>
> You have a significant misunderstanding of how heap and stack memories work. It's true that many architectures provide registers designed specifically to access stack memory, but it is still memory--it's just that those registers provide more convenient access to the stack, though a lot of that is also legacy baggage.
>
> Local stack memory is often faster because it's used more often and persists in the L1 data cache. But it's not in registers to be sure.
>
> Cheers,
> - Rick C. Hodgin
>
> --
Accepted. My knowledge of computer science is very inferior. But is it
not true that Bjarne Stroustrup himself proposed RAII to negate some
of the problems caused by heap allocation. Also, you can refer to this
Polymorphism without Heap Memory | Embedded Systems Experts which
describes problems associated with heap. Many of my concepts may be
wrong but heap is definitely source of lots of problems.
--
Best regards,
Shiv Shankar Dayal