* fork.cc (fork_child): Move mmap initialization.

* shared.cc (shared_info::heap_chunk_size): Store info as megabytes.  Search
HKEY_LOCAL_MACHINE as well as HKEY_CURRENT_USER.
* shared_info.h (shared_info::initial_heap_size): Change element name to
reflect new functionality.
* strace.cc (strace::hello): Report on initial heap size.
This commit is contained in:
Christopher Faylor 2002-10-18 23:52:59 +00:00
parent 978ea3cf1c
commit 60bc7b5977
5 changed files with 32 additions and 13 deletions

View File

@ -1,3 +1,12 @@
2002-10-18 Christopher Faylor <cgf@redhat.com>
* fork.cc (fork_child): Move mmap initialization.
* shared.cc (shared_info::heap_chunk_size): Store info as megabytes.
Search HKEY_LOCAL_MACHINE as well as HKEY_CURRENT_USER.
* shared_info.h (shared_info::initial_heap_size): Change element name
to reflect new functionality.
* strace.cc (strace::hello): Report on initial heap size.
2002-10-18 Thomas Pfaff <tpfaff@gmx.net>
* thread.cc (verifyable_object_isvalid): Test for a valid object

View File

@ -280,14 +280,14 @@ fork_child (HANDLE& hParent, dll *&first_dll, bool& load_dlls)
cygheap->fdtab.fixup_after_fork (hParent);
ProtectHandleINH (hParent);
if (fixup_mmaps_after_fork (hParent))
api_fatal ("recreate_mmaps_after_fork_failed");
pinfo_fixup_after_fork ();
signal_fixup_after_fork ();
MALLOC_CHECK;
if (fixup_mmaps_after_fork (hParent))
api_fatal ("recreate_mmaps_after_fork_failed");
/* If we haven't dynamically loaded any dlls, just signal
the parent. Otherwise, load all the dlls, tell the parent
that we're done, and wait for the parent to fill in the.

View File

@ -223,7 +223,8 @@ memory_init ()
unsigned
shared_info::heap_chunk_size ()
{
if (!heap_chunk_in_mb)
unsigned val;
if (!initial_heap_size)
{
/* Fetch misc. registry entries. */
@ -234,13 +235,20 @@ shared_info::heap_chunk_size ()
/* FIXME: We should not be restricted to a fixed size heap no matter
what the fixed size is. */
heap_chunk_in_mb = reg.get_int ("heap_chunk_in_mb", 256);
if (heap_chunk_in_mb < 4)
{
heap_chunk_in_mb = 4;
reg.set_int ("heap_chunk_in_mb", heap_chunk_in_mb);
}
initial_heap_size = reg.get_int ("heap_chunk_in_mb", 0);
if (!initial_heap_size) {
reg_key r1 (HKEY_LOCAL_MACHINE, KEY_READ, "SOFTWARE",
CYGWIN_INFO_CYGNUS_REGISTRY_NAME,
CYGWIN_INFO_CYGWIN_REGISTRY_NAME, NULL);
initial_heap_size = reg.get_int ("heap_chunk_in_mb", 384);
}
if (initial_heap_size < 4)
initial_heap_size = 4 * 1024 * 1024;
else
initial_heap_size <<= 20;
debug_printf ("fixed heap size is %u", initial_heap_size);
}
return heap_chunk_in_mb << 20;
return initial_heap_size;
}

View File

@ -138,7 +138,7 @@ public:
#define SHARED_INFO_CB 47112
#define CURR_SHARED_MAGIC 0x29eb8ccdU
#define CURR_SHARED_MAGIC 0xd9e0bc22U
/* NOTE: Do not make gratuitous changes to the names or organization of the
below class. The layout is checksummed to determine compatibility between
@ -148,7 +148,7 @@ class shared_info
DWORD version;
DWORD cb;
public:
int heap_chunk_in_mb;
unsigned initial_heap_size;
DWORD sys_mount_table_counter;
tty_list tty;

View File

@ -19,6 +19,7 @@ details. */
#include "cygwin_version.h"
#include "hires.h"
#include "cygthread.h"
#include "shared_info.h"
#define PROTECT(x) x[sizeof (x)-1] = 0
#define CHECK(x) if (x[sizeof (x)-1] != 0) { small_printf ("array bound exceeded %d\n", __LINE__); ExitProcess (1); }
@ -57,6 +58,7 @@ strace::hello ()
cygwin_version.api_major, cygwin_version.api_minor);
prntf (1, NULL, "DLL build: %s", cygwin_version.dll_build_date);
prntf (1, NULL, "OS version: Windows %s", wincap.osname ());
prntf (1, NULL, "Heap size: %u", cygwin_shared->heap_chunk_size ());
prntf (1, NULL, "**********************************************");
}
}