Re: [Gc] Patch for MAX_HEAP_SECTS value
ivmai at mail.ru
Sat Sep 19 02:09:46 PDT 2009
"Boehm, Hans" <hans.boehm at hp.com> wrote:
> Partial answer to other questions:
> GC_mem_top_down used to be essential for 64-bit debugging on win32, so that stores of addresses to ints would actually fail. I suspect that still applies.
> > 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).
More information about the Gc