emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Warnings in mingw64 build on emacs-28 branch


From: Eli Zaretskii
Subject: Re: Warnings in mingw64 build on emacs-28 branch
Date: Sun, 07 Nov 2021 20:39:45 +0200

> From: Óscar Fuentes <ofv@wanadoo.es>
> Date: Sun, 07 Nov 2021 16:51:56 +0100
> 
> AFAIU that call to VirtualQuery does not do what we want. When lpAddress
> is provided the function rounds down the address to a page boundary and
> starts scanning pages *up*. Since we want information about the capacity
> of the stack, the scan ignores all the space below the current page
> boundary.

How do you see that it _ignores_ that space?  The code does this:

        rlp->rlim_cur = (DWORD_PTR) &m - (DWORD_PTR) m.AllocationBase;

m.AllocationBase is not the page of 'm', it's the base address of a
range of pages to which 'm' belongs.  And since Emacs calls getrlimit
very early during its startup, directly from 'main', 'm' is not far
from the beginning of the stack, and m.AllocationBase is very likely
to be the base address of the memory initially allocated for the
stack.

It is a matter of fact that the result of this code produces the 8MB
stack size that Emacs on Windows is compiled to use (see the link
command in src/Makefile.in).  So it isn't just the theory, that code
actually works.

So I think we are okay in that department.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]