This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Memory Management on AMD64 in 32-bit mode


On Dec  9 12:55, Benson Margulies wrote:
> I assume that there's a very strong reason why this code can't just
> allocate a stack any-old-place (calling VirtualAlloc with first arg 0)
> and use it. What I don't understand is the nature of the constraints. If
> the parent needs to know, why not have stack_base make a call to
> VirtualAlloc with first arg 0 to allocate a brand-new region, on the
> theory that such a region is a lot more likely to end up with a
> corresponding hole in the child process?

Just an example:

void foo()
{
  int x = 1;
  int *xp = &x;

  if (!fork())            /* Child */
    printf ("%d\n", *xp); 
}

What happens if the stack of the child has been allocated at another
address as the parent's stack?

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin@cygwin.com
Red Hat, Inc.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]