• Register
First time here? Checkout the FAQ!
x
Welcome to Find4Answers.com

Where you can Ask Questions, Find Answers Or Receive Answers from other members of the community And Share in Social networking sites like facebook, linkedin, twitter.
3cx phone system assignment writing service bandar bola best waikiki restaurants boiler business car car insurance quotes car insurance quotes car insurance quotes car lease deals car leasing uk chwilówka przez internet zapewne company convey convey law complaints convey law reviews convey law service conveylaw cosmetic dentist csr classics hack csr classics hack csr classics hack data data recovery maidenhead deals design development double glazing leeds electrician electrician manchester electricians emergency farm filmy bez limitu filmy online finlock finlock solutions general genral golf holidays spain graduate jobs in london graduate jobs london heap how to jump higher how to jump higher how to jump higher infrared sauna infrared sauna saunas inline skating java judi bola law law firm in leeds lease leasing led lights led bulbs leeds legal smoke life insurance quotes log london manchester mercedes lease deals mercedes leasing mezzanine movies museums and art nikogo szybka chwilówka none none none ny male revue outsource link building paid search agency performance car hire personal personal injury lawyer porcelain veneers ramię szybkie chwilówki recovery restaurant seo seo agencies seo company seo company london seo las vegas seo services services sky diamond seo solutions steel synchronization szybka chwilówka przykład szybka chwilówka żaden szybkie chwilówki lekko temp cover car insurance temp cover car insurance temp cover car insurance thread tymczasem chwilówki przez internet upvc windows manchester viagra kamagra videos vinyl flooring suppliers wait web development company window repairs london windows zobaczyć szybka chwilówka

Can a function be allocated on the heap instead of a stack? [poll]

0 votes
Can a function be allocated on the heap instead of a stack?
Choices:
Yes (0 votes)
No (1 vote)
related to an answer for: What is stored on Stack and Heap ?
asked Nov 16, 2011 in Java/J2EE by anonymous
    

1 Answer

0 votes

No, activation records for functions (i.e. local or automatic variables) are allocated on the stack that is used not only to store these variables, but also keep track of nested function calls.

How the heap is managed is really up to the run-time environment. C uses malloc and C++ uses new, but many other languages have garbage collection.

However, the stack is more low level feature closely tied to the processor architecture. Growing the heap when there is not enough space isn't too hard since it can be implemented in the library call that handles the heap. However, growing the stack is often impossible as the stack overflow only is discovered when it is too late and shutting down the thread of execution is the only viable option.

answered Nov 16, 2011 by javaboy Hot Users (380 points)

Related questions

0 votes
3 answers 187 views
0 votes
2 answers 92 views
0 votes
3 answers 325 views
asked Nov 6, 2011 in Computers by sarada Hot Users (2,340 points)
0 votes
1 answer 217 views
...