aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/shared.cc
diff options
context:
space:
mode:
authorPierre Humblet <phumblet@phumblet.no-ip.org>2004-12-03 02:00:37 +0000
committerPierre Humblet <phumblet@phumblet.no-ip.org>2004-12-03 02:00:37 +0000
commit8151e674bafcd9a4a54caa1cba6685737354cc6b (patch)
treeb2e00e4b4bfbb14c8c1240dbb85d041bd0604a50 /winsup/cygwin/shared.cc
parent3263f819aa5e0d90a9a7203b3c98156bb4012229 (diff)
downloadnewlib-8151e674bafcd9a4a54caa1cba6685737354cc6b.zip
newlib-8151e674bafcd9a4a54caa1cba6685737354cc6b.tar.gz
newlib-8151e674bafcd9a4a54caa1cba6685737354cc6b.tar.bz2
2004-12-03 Pierre Humblet <pierre.humblet@ieee.org>
* registry.h (reg_key::reg_key): Change arguments. * shared_info.h (class mount_info): Remove had_to_create_mount_areas. * registry.cc (reg_key::reg_key): Change constructors to always handle HKLM and to avoid relying on HKCU. Do not set mount_table->had_to_create_mount_areas. * path.cc (mount_info::conv_to_win32_path): Improve update of sys_mount_table_counter. (mount_info::read_mounts): Use new reg_key constructor. (mount_info::add_reg_mount): Ditto. (mount_info::del_reg_mount): Ditto. (mount_info::read_cygdrive_info_from_registry): Ditto. (mount_info::write_cygdrive_info_to_registry): Ditto. Update cygwin_shared->sys_mount_table_counter after registry update. (mount_info::get_cygdrive_info): Ditto. * shared.cc (shared_info::heap_chunk_size): Use new reg_key constructor. * environ.cc (regopt): Ditto.
Diffstat (limited to 'winsup/cygwin/shared.cc')
-rw-r--r--winsup/cygwin/shared.cc30
1 files changed, 14 insertions, 16 deletions
diff --git a/winsup/cygwin/shared.cc b/winsup/cygwin/shared.cc
index 86c66a4..b276f92 100644
--- a/winsup/cygwin/shared.cc
+++ b/winsup/cygwin/shared.cc
@@ -250,22 +250,20 @@ shared_info::heap_chunk_size ()
{
if (!heap_chunk)
{
- /* Fetch misc. registry entries. */
-
- reg_key reg (KEY_READ, NULL);
-
- /* Note that reserving a huge amount of heap space does not result in
- the use of swap since we are not committing it. */
- /* FIXME: We should not be restricted to a fixed size heap no matter
- what the fixed size is. */
-
- heap_chunk = reg.get_int ("heap_chunk_in_mb", 0);
- if (!heap_chunk) {
- reg_key r1 (HKEY_LOCAL_MACHINE, KEY_READ, "SOFTWARE",
- CYGWIN_INFO_CYGNUS_REGISTRY_NAME,
- CYGWIN_INFO_CYGWIN_REGISTRY_NAME, NULL);
- heap_chunk = r1.get_int ("heap_chunk_in_mb", 384);
- }
+ /* Fetch from registry, first user then local machine. */
+ for (int i = 0; i < 2; i++)
+ {
+ reg_key reg (i, KEY_READ, NULL);
+
+ /* Note that reserving a huge amount of heap space does not result in
+ the use of swap since we are not committing it. */
+ /* FIXME: We should not be restricted to a fixed size heap no matter
+ what the fixed size is. */
+
+ if ((heap_chunk = reg.get_int ("heap_chunk_in_mb", 0)))
+ break;
+ heap_chunk = 384; /* Default */
+ }
if (heap_chunk < 4)
heap_chunk = 4 * 1024 * 1024;