[Gc] Patch for MAX_HEAP_SECTS value
hans.boehm at hp.com
Sat Sep 19 11:27:22 PDT 2009
> From: Ivan Maidanski
> > > PS. Another Q: Why do we add 1 (to bytes) for VirtualAlloc() in
> > > GC_win32_get_mem?
> > It keeps the heap sections discontiguous, which prevents
> blocks from spanning regions which, based on the comment
> could result in bad VirtualProtect calls in some
> configurations. It may be that this is unnecessary without
> MPROTECT_VDB. I'm not sure.
> In retrospection, "+1" (and the accompanying comment) was
> added in gc6.1 when a lot of other MPROTECT-related code has
> been changed. "+1" is not needed for GWW or for unmapping
> (since VirtualQuery() is used there).
It sounds very plausible to me that we could change this if MPROTECT_VDB is not defined. And it would reduce fragmentation, which may be more of an issue than the occasional untouched page. But it would require testing to check that we're not overlooking something.
More information about the Gc