[Gc] Small patch to allow initial and maximum heap sizesto be>2GB.

Talbot, George Gtalbot at locuspharma.com
Thu May 28 12:50:25 PDT 2009


Here's the patch again with strtoull() and _strtoui64()

--
George T. Talbot
<gtalbot at locuspharma.com>



gtalbot at germanium:~/work/current/lcfs/gc-cvs/bdwgc$ cvs diff misc.c
Index: misc.c
===================================================================
RCS file: /cvsroot/bdwgc/bdwgc/misc.c,v
retrieving revision 1.25
diff -r1.25 misc.c
18a19
> #include <stdlib.h>
684c685,699
<         initial_heap_sz = atoi(sz_str);
---
>
>       char* dummy;
>
> #ifdef _WIN64
>       initial_heap_sz = _strtoui64(sz_str, &dummy, 0);
> #elif defined __GNUC__
>         initial_heap_sz = strtoull(sz_str, &dummy, 0);
>
>       if (initial_heap_sz == 0xffffffffffffffffull)
>       {
>           initial_heap_sz   = 0;
>       }
> #else
>         initial_heap_sz = atol(sz_str);
> #endif
695c710,722
<         word max_heap_sz = (word)atol(sz_str);
---
>       char* dummy;
> #ifdef _WIN64
>       word max_heap_sz = _strtoui64(sz_str, &dummy, 0);
> #elif defined __GNUC__
>         word max_heap_sz = strtoull(sz_str, &dummy, 0);
>
>       if (max_heap_sz == 0xffffffffffffffffull)
>       {
>           max_heap_sz   = 0;
>       }
> #else
>         word max_heap_sz = atol(sz_str);
> #endif



More information about the Gc mailing list