[Wine] Wine memory limitation for malloc?

Adept wineforum-user at winehq.org
Mon Jul 21 12:26:31 CDT 2008


Why win32 application under Wine can allocate only 2000 MB of memory, but same programm translated by gcc can get 3800 MB.
(OS/Compilers - WinXP/Visual C 6.0 32 bit, and openSUSE 11 x64/gcc -m32)

#include <stdlib.h>
#include <stdio.h>
#include <time.h>

main(int argc, char **argv)
{unsigned long n,m,i; int *p,*p1,*p2,*p3; clock_t time1,time2;
i=4095; if (argc == 2) i = (size_t) strtoul(argv[1], NULL, 0);
m=i*1024*1024; while(  (p=(int*)malloc(m)) ==0 ) m-=1024l*1024l;
printf("Allocated %u MB  ( %u bytes )\n",m/1024l/1024l,m);
getchar(); free(p); exit(0);
}







More information about the wine-users mailing list