Subject: bug#18995: Error: Could not reserve dynamic heap area.

From: Eli Zaretskii <[email-masked]>
Date: Sat, 08 Nov 2014 19:29:08 +0200

> Date: Sat, 8 Nov 2014 16:22:56 +0100
> From: Alexander Shukaev <[email-masked]>
> 
> When I build `emacs-24', Emacs is being configured with
> 
> Should Emacs use the GNU version of malloc? yes
> Should Emacs use a relocating allocator for buffers? yes
> Should Emacs use mmap(2) for buffer allocation? no
> 
> With this configuration the x64 version is built just fine, but the x86 version
> build fails with
> 
>     make[2]: Entering directory
>     '/c/Users/Haroogan/Projects/GitHub/MINGW-packages/mingw-w64-emacs/src/.build/i686-w64-mingw32/lisp'
>    
>     Compiling
>     /C/Users/Haroogan/Projects/GitHub/MINGW-packages/mingw-w64-emacs/src/emacs/lisp/emacs-lisp/macroexp.el
>    
>     Error: Could not reserve dynamic heap area.
> 
> I've checked what is called in this case and it seems to be fine at the first
> glance:

Sorry, I don't understand: what part of the allocate_heap function is
being run and fails in your case?  Does the loop start with
0x4000000000 or with 0x68000000?  Does it go all the way through
0x00100000, and each call to VirtualAlloc fails?  If so, can you see
what error code does VirtualAlloc return?  You can accomplish the
latter in GDB like this:

  (gdb) p w32_last_error()

Also, does the same command succeed if you run it from the Bash
command line?  Does it succeed if you run it from the cmd.exe command
line?

Finally, did you run the build from the Bash command line outside
Emacs, or did you run it from inside another Emacs session?