diff options
author | Christopher Faylor <me@cgf.cx> | 2002-10-18 23:52:59 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2002-10-18 23:52:59 +0000 |
commit | 60bc7b5977b45844adb1223096066d635d6da0a2 (patch) | |
tree | 8d4efcd95b8be087fdbe4fecc6742fb043897ccf /winsup/cygwin/shared.cc | |
parent | 978ea3cf1c7b0e06791df78ade33d3c8201d7a15 (diff) | |
download | newlib-60bc7b5977b45844adb1223096066d635d6da0a2.zip newlib-60bc7b5977b45844adb1223096066d635d6da0a2.tar.gz newlib-60bc7b5977b45844adb1223096066d635d6da0a2.tar.bz2 |
* 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.
Diffstat (limited to 'winsup/cygwin/shared.cc')
-rw-r--r-- | winsup/cygwin/shared.cc | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/winsup/cygwin/shared.cc b/winsup/cygwin/shared.cc index 59ca349..45d51c3 100644 --- a/winsup/cygwin/shared.cc +++ b/winsup/cygwin/shared.cc @@ -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; } |