Jump to content

Talk:Stack-based memory allocation

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Alexander Patrakov (talk | contribs) at 13:16, 6 April 2007 (Noticed poor wording). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

Poor wording

The article says:

Another disadvantage is that the memory stored on the stack must be deallocated when the function that created it returns, so that other functions that want to make use of it beyond its lifetime must copy the data

The bug is that

  • "must be deallocated" implies that there is some action on behalf of the programmer
  • the function being called, not the other function, must copy the data

Maybe: Another disadvantage is that the memory stored on the stack is automatically deallocated when the function that created it returns, and thus the function must copy the data if they should be available to other parts of the program after it returns.

If nobody has objections, I will make the change at 2007-04-14.