Memory problem in winelib apps?

Mike McCormack mike at
Tue Jun 21 20:42:06 CDT 2005

Walt Ogburn wrote:

> #define BUFSIZE 1044096
> /* #define BUFSIZE 2000000 */
> int PASCAL WinMain (HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
> {
>    char buf[BUFSIZE];
>    int i;

Wine allocates a 1Mb stack by default, and more if a larger stack size 
is specified in a PE executeable's header.  You can specify the size of 
the a's stack by making a def file for it, and adding the line


that should fix the problem, however allocating a 2M buffer on the stack 
seems like a waste of stack space, so it would be better to fix the 
program to allocate memory on the heap, or directly using mmap.


More information about the wine-devel mailing list