U
U
Urukhayy2014-11-20 16:30:42
Programming
Urukhayy, 2014-11-20 16:30:42

Is the stack a reserved area of ​​memory on random access memory?

Good day. Is the stack a reserved area of ​​memory on random access memory? And the heap does not reserve?
And is there a concept of "stack" and "heap" not in compiled programming languages?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
tsarevfs, 2014-11-20
@tsarevfs

It all depends on the language, platform and OS.
When people talk about the heap, they usually mean dynamic memory allocation. At startup, the application does not reserve memory on the heap, but does so as needed.
If you write, for example, in C ++ for the x86 platform, then the stack memory (several megabytes) is reserved at the very beginning of the application and is released only when it ends.
For different languages, how the stack is implemented can be very different, the only important thing is that this is a mandatory part of the mechanism for how functions work. It is through it that arguments are passed, the result is returned. Local variables for functions can be created on it.
Interpreted languages ​​can be arranged in very different ways. But in most cases they behave as if they have a stack and a heap.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question