lkml.org 
[lkml]   [1999]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: which stack direction?
From
Date
Keith Owens <kaos@ocs.com.au> writes:

|> On Mon, 15 Mar 1999 08:12:39 +1300,
|> Chris Wedgwood <cw@ix.net.nz> wrote:
|> >On Fri, Mar 12, 1999 at 11:45:36AM -0800, Larry McVoy wrote:
|> >> "Does it matter to Linux whether the stacks in user codes run up
|> >> (pointer starts at a low address and increments to get more memory)
|> >> or down (pointer starts at a high address and decrements to get
|> >> more memory)? If it does matter, which is preferred?"
|> >
|> >As someone else has pointed out, if the stack doesn't grow down, then
|> >it not so easy to make the stack and the heap grow towards each
|> >other.
|>
|> Why? Stack starts at the bottom and grows up, heap starts at the top
|> and "grows" down. There is no requirement for heap addresses to be in
|> any particular order. When heap is full, just grab the next page below
|> the lowest heap page, grab n pages if the entity requires more than one
|> page.

Except that many, if not all malloc implementations "know" that the heap
grows upward.

--
Andreas Schwab "And now for something
schwab@issan.cs.uni-dortmund.de completely different"
schwab@gnu.org

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:50    [W:0.349 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site