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

Boehm, Hans hans.boehm at hp.com
Fri Jun 12 10:56:16 PDT 2009


Thanks.

Could you resubmit this with a few changes:

1) # if indentation should be consistent with the rest of the code.  (Preprocessor commands should be on their own line, "#" in column 1, the rest indented appropriately.)

2) Please use ULLONG_MAX instead of the magic constant.  Actually, it appears that _UI64_MAX plays a similar role on Windows?  Both no doubt require limits.h.

3) Could you attach some form of context diff (e.g. -u) instead of inligning it?  The inlined version tends to get mangled by mailers.  The no-context versions are a bit dangerous to apply.

Hans



> -----Original Message-----
> From: gc-bounces at napali.hpl.hp.com 
> [mailto:gc-bounces at napali.hpl.hp.com] On Behalf Of Talbot, George
> Sent: Thursday, May 28, 2009 12:50 PM
> To: Talbot, George; 'Ivan Maidanski'; gc at linux.hpl.hp.com
> Subject: RE: Re[4]: [Gc] Small patch to allow initial and 
> maximum heap sizesto be>2GB.
> 
> 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
> 
> _______________________________________________
> Gc mailing list
> Gc at linux.hpl.hp.com
> http://www.hpl.hp.com/hosted/linux/mail-archives/gc/
> 


More information about the Gc mailing list