* cygheap.h (struct user_heap_info): Add slop member.

* heap.cc (heap_init): Add slop factor to heap allocation.  Add
	comment.
	* mmap.cc (MapViewNT): Allocate memory maps top down.
	(fhandler_dev_zero::mmap): Ditto.
	* shared.cc (shared_info::heap_slop_size): New method.
	(shared_info::heap_chunk_size): Don't use debug_printf at early stage.
	* shared_info.h (SHARED_INFO_CB): Accomodate change to shared_info.
	(CURR_SHARED_MAGIC): Ditto.
	(class shared_info): Add heap_slop member.  Declare heap_slop_size.
	* wincap.h: Define heapslop throughout.
	* wincap.cc: Ditto.
This commit is contained in:
Corinna Vinschen
2006-10-31 18:41:16 +00:00
parent 9740f34d11
commit c2b10dc4d8
8 changed files with 91 additions and 10 deletions

View File

@ -234,6 +234,33 @@ memory_init ()
mtinfo_init ();
}
unsigned
shared_info::heap_slop_size ()
{
if (!heap_slop)
{
/* Fetch from registry, first user then local machine. */
for (int i = 0; i < 2; i++)
{
reg_key reg (i, KEY_READ, NULL);
if ((heap_slop = reg.get_int ("heap_slop_in_mb", 0)))
break;
heap_slop = wincap.heapslop ();
}
if (heap_slop < 0)
heap_slop = 0;
else
heap_slop <<= 20;
#ifdef DEBUGGING
system_printf ("fixed heap slop is %p", heap_slop);
#endif
}
return heap_slop;
}
unsigned
shared_info::heap_chunk_size ()
{
@ -260,7 +287,9 @@ shared_info::heap_chunk_size ()
heap_chunk <<= 20;
if (!heap_chunk)
heap_chunk = 384 * 1024 * 1024;
debug_printf ("fixed heap size is %u", heap_chunk);
#ifdef DEBUGGING
system_printf ("fixed heap size is %u", heap_chunk);
#endif
}
return heap_chunk;