diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 2001-05-01 11:50:55 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 2001-05-01 11:50:55 +0000 |
commit | b270570dfe9bf0101ccb445eee0c9842eea7fb18 (patch) | |
tree | 84d8c1b7562d5557326c45bc62554865db1418b1 | |
parent | 71f3ca3c7b2e595afa9cdd2e23d114d668865c49 (diff) | |
download | ATCD-b270570dfe9bf0101ccb445eee0c9842eea7fb18.tar.gz |
ChangeLogTag:Tue May 1 06:15:26 2001 Douglas C. Schmidt <schmidt@tango.doc.wustl.edu>
-rw-r--r-- | ChangeLog | 39 | ||||
-rw-r--r-- | ChangeLogs/ChangeLog-02a | 39 | ||||
-rw-r--r-- | ChangeLogs/ChangeLog-03a | 39 | ||||
-rw-r--r-- | THANKS | 1 | ||||
-rw-r--r-- | ace/Hash_Map_Manager_T.h | 2 | ||||
-rw-r--r-- | ace/Local_Name_Space_T.cpp | 5 | ||||
-rw-r--r-- | ace/Mem_Map.cpp | 79 | ||||
-rw-r--r-- | ace/OS.h | 3 | ||||
-rw-r--r-- | ace/OS.i | 45 | ||||
-rw-r--r-- | ace/ace_wchar.h | 6 | ||||
-rw-r--r-- | tests/MEM_Stream_Test.cpp | 2 | ||||
-rw-r--r-- | tests/Malloc_Test.cpp | 55 |
12 files changed, 254 insertions, 61 deletions
diff --git a/ChangeLog b/ChangeLog index db9a9d3d411..33b8994b449 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,29 @@ +Tue May 1 06:15:26 2001 Douglas C. Schmidt <schmidt@tango.doc.wustl.edu> + + * ace/Hash_Map_Manager_T.h (class ACE_Hash_Map_Manager_Ex): Fixed + an erroneous comment. Thanks to Mark Drijver + <mdrijver@remedy.nl> for finding this. + + * ace/Local_Name_Space_T.cpp (create_manager_i): It's now valid + to use fixed mmap addresses on Win9x. Thanks to Cristian Ferretti + <cristian_ferretti@yahoo.com> for these fixes. + + * ace/Mem_Map.{h,i}, + * ace/ace_wchar.h, + * ace/OS.{h,i}: Added support to the ACE_OS::mmap() function and + ACE_Mem_Map class so they work properly on Win9x. Thanks to + Cristian Ferretti <cristian_ferretti@yahoo.com> for these fixes. + + * tests/Malloc_Test.cpp (main): Updated this test so that it + doesn't try to do any remapping or alternative child address + ranges on Win9x. Thanks to Cristian Ferretti + <cristian_ferretti@yahoo.com> for pointing this out. + + * tests/MEM_Stream_Test.cpp (handle_input): Make sure to multiple + MAXPATHLEN * sizeof (ACE_CHAR) to handle Unicode properly. + Thanks to Cristian Ferretti <cristian_ferretti@yahoo.com> for + pointing this out. + Mon Apr 30 12:56:03 2001 Balachandran Natarajan <bala@cs.wustl.edu> * bin/nightlybuilds/builds.lst : Removed RAPI of the scoreboard. @@ -9,6 +35,16 @@ Sun Apr 29 15:20:00 2001 Michael Kircher <Michael.Kircher@mchp.siemens.de> Added a flag to the Pluggable UDP test, so that it does not get run in environments using only statically linked libraries. +Sun Apr 29 11:44:26 2001 Douglas C. Schmidt <schmidt@tango.doc.wustl.edu> + + * ace/ace_wchar.h: Reverted the following change + + Tue Apr 24 06:28:00 2001 Douglas C. Schmidt <schmidt@tango.doc.wustl.edu> + * ace/ace_wchar.h: Fixed some code for VxWorks. Thanks to + Albert Wijnja <Albert.Wijnja@meco.nl> for reporting this. + + This change is confusing since it's inconsistent with other + platforms that enable ACE_TEXT_WIDE. Thu Apr 26 20:14:48 2001 Balachandran Natarajan <bala@cs.wustl.edu> @@ -187,9 +223,6 @@ Tue Apr 24 06:28:00 2001 Douglas C. Schmidt <schmidt@tango.doc.wustl.edu> open() rather than constructors. Thanks to Stan Pinte <spinte@latinia.com> for motivating this. - * ace/ace_wchar.h: Fixed some code for VxWorks. Thanks to - Albert Wijnja <Albert.Wijnja@meco.nl> for reporting this. - Sat Apr 14 10:51:39 2001 Carlos O'Ryan <coryan@uci.edu> * ace/Log_Msg.h: diff --git a/ChangeLogs/ChangeLog-02a b/ChangeLogs/ChangeLog-02a index db9a9d3d411..33b8994b449 100644 --- a/ChangeLogs/ChangeLog-02a +++ b/ChangeLogs/ChangeLog-02a @@ -1,3 +1,29 @@ +Tue May 1 06:15:26 2001 Douglas C. Schmidt <schmidt@tango.doc.wustl.edu> + + * ace/Hash_Map_Manager_T.h (class ACE_Hash_Map_Manager_Ex): Fixed + an erroneous comment. Thanks to Mark Drijver + <mdrijver@remedy.nl> for finding this. + + * ace/Local_Name_Space_T.cpp (create_manager_i): It's now valid + to use fixed mmap addresses on Win9x. Thanks to Cristian Ferretti + <cristian_ferretti@yahoo.com> for these fixes. + + * ace/Mem_Map.{h,i}, + * ace/ace_wchar.h, + * ace/OS.{h,i}: Added support to the ACE_OS::mmap() function and + ACE_Mem_Map class so they work properly on Win9x. Thanks to + Cristian Ferretti <cristian_ferretti@yahoo.com> for these fixes. + + * tests/Malloc_Test.cpp (main): Updated this test so that it + doesn't try to do any remapping or alternative child address + ranges on Win9x. Thanks to Cristian Ferretti + <cristian_ferretti@yahoo.com> for pointing this out. + + * tests/MEM_Stream_Test.cpp (handle_input): Make sure to multiple + MAXPATHLEN * sizeof (ACE_CHAR) to handle Unicode properly. + Thanks to Cristian Ferretti <cristian_ferretti@yahoo.com> for + pointing this out. + Mon Apr 30 12:56:03 2001 Balachandran Natarajan <bala@cs.wustl.edu> * bin/nightlybuilds/builds.lst : Removed RAPI of the scoreboard. @@ -9,6 +35,16 @@ Sun Apr 29 15:20:00 2001 Michael Kircher <Michael.Kircher@mchp.siemens.de> Added a flag to the Pluggable UDP test, so that it does not get run in environments using only statically linked libraries. +Sun Apr 29 11:44:26 2001 Douglas C. Schmidt <schmidt@tango.doc.wustl.edu> + + * ace/ace_wchar.h: Reverted the following change + + Tue Apr 24 06:28:00 2001 Douglas C. Schmidt <schmidt@tango.doc.wustl.edu> + * ace/ace_wchar.h: Fixed some code for VxWorks. Thanks to + Albert Wijnja <Albert.Wijnja@meco.nl> for reporting this. + + This change is confusing since it's inconsistent with other + platforms that enable ACE_TEXT_WIDE. Thu Apr 26 20:14:48 2001 Balachandran Natarajan <bala@cs.wustl.edu> @@ -187,9 +223,6 @@ Tue Apr 24 06:28:00 2001 Douglas C. Schmidt <schmidt@tango.doc.wustl.edu> open() rather than constructors. Thanks to Stan Pinte <spinte@latinia.com> for motivating this. - * ace/ace_wchar.h: Fixed some code for VxWorks. Thanks to - Albert Wijnja <Albert.Wijnja@meco.nl> for reporting this. - Sat Apr 14 10:51:39 2001 Carlos O'Ryan <coryan@uci.edu> * ace/Log_Msg.h: diff --git a/ChangeLogs/ChangeLog-03a b/ChangeLogs/ChangeLog-03a index db9a9d3d411..33b8994b449 100644 --- a/ChangeLogs/ChangeLog-03a +++ b/ChangeLogs/ChangeLog-03a @@ -1,3 +1,29 @@ +Tue May 1 06:15:26 2001 Douglas C. Schmidt <schmidt@tango.doc.wustl.edu> + + * ace/Hash_Map_Manager_T.h (class ACE_Hash_Map_Manager_Ex): Fixed + an erroneous comment. Thanks to Mark Drijver + <mdrijver@remedy.nl> for finding this. + + * ace/Local_Name_Space_T.cpp (create_manager_i): It's now valid + to use fixed mmap addresses on Win9x. Thanks to Cristian Ferretti + <cristian_ferretti@yahoo.com> for these fixes. + + * ace/Mem_Map.{h,i}, + * ace/ace_wchar.h, + * ace/OS.{h,i}: Added support to the ACE_OS::mmap() function and + ACE_Mem_Map class so they work properly on Win9x. Thanks to + Cristian Ferretti <cristian_ferretti@yahoo.com> for these fixes. + + * tests/Malloc_Test.cpp (main): Updated this test so that it + doesn't try to do any remapping or alternative child address + ranges on Win9x. Thanks to Cristian Ferretti + <cristian_ferretti@yahoo.com> for pointing this out. + + * tests/MEM_Stream_Test.cpp (handle_input): Make sure to multiple + MAXPATHLEN * sizeof (ACE_CHAR) to handle Unicode properly. + Thanks to Cristian Ferretti <cristian_ferretti@yahoo.com> for + pointing this out. + Mon Apr 30 12:56:03 2001 Balachandran Natarajan <bala@cs.wustl.edu> * bin/nightlybuilds/builds.lst : Removed RAPI of the scoreboard. @@ -9,6 +35,16 @@ Sun Apr 29 15:20:00 2001 Michael Kircher <Michael.Kircher@mchp.siemens.de> Added a flag to the Pluggable UDP test, so that it does not get run in environments using only statically linked libraries. +Sun Apr 29 11:44:26 2001 Douglas C. Schmidt <schmidt@tango.doc.wustl.edu> + + * ace/ace_wchar.h: Reverted the following change + + Tue Apr 24 06:28:00 2001 Douglas C. Schmidt <schmidt@tango.doc.wustl.edu> + * ace/ace_wchar.h: Fixed some code for VxWorks. Thanks to + Albert Wijnja <Albert.Wijnja@meco.nl> for reporting this. + + This change is confusing since it's inconsistent with other + platforms that enable ACE_TEXT_WIDE. Thu Apr 26 20:14:48 2001 Balachandran Natarajan <bala@cs.wustl.edu> @@ -187,9 +223,6 @@ Tue Apr 24 06:28:00 2001 Douglas C. Schmidt <schmidt@tango.doc.wustl.edu> open() rather than constructors. Thanks to Stan Pinte <spinte@latinia.com> for motivating this. - * ace/ace_wchar.h: Fixed some code for VxWorks. Thanks to - Albert Wijnja <Albert.Wijnja@meco.nl> for reporting this. - Sat Apr 14 10:51:39 2001 Carlos O'Ryan <coryan@uci.edu> * ace/Log_Msg.h: @@ -1222,6 +1222,7 @@ Stan Pinte <spinte@latinia.com> Dayisi <dayisi@163.com> Peter Georgakakis <peterg@gdc.ca> Richard Hardgrave <hardgrav@ttd.teradyne.com> +Mark Drijver <mdrijver@remedy.nl> I would particularly like to thank Paul Stephenson, who worked with me at Ericsson in the early 1990's. Paul devised the recursive Makefile diff --git a/ace/Hash_Map_Manager_T.h b/ace/Hash_Map_Manager_T.h index a1b24bf3d77..7b721f3c365 100644 --- a/ace/Hash_Map_Manager_T.h +++ b/ace/Hash_Map_Manager_T.h @@ -144,7 +144,7 @@ public: /// Removes all the entries in <Map_Manager_Ex>. int unbind_all (void); - /// Initialize a <Hash_Map_Manager_Ex> with size <length>. + /// Cleanup the <Hash_Map_Manager_Ex>. ~ACE_Hash_Map_Manager_Ex (void); /** diff --git a/ace/Local_Name_Space_T.cpp b/ace/Local_Name_Space_T.cpp index eb049870012..a341a4b9c41 100644 --- a/ace/Local_Name_Space_T.cpp +++ b/ace/Local_Name_Space_T.cpp @@ -404,12 +404,7 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::create_manager_i (void) ACE_OS::strcat (this->context_file_, database); #if !defined (CHORUS) -# if defined(ACE_WIN32) && \ - (!defined(ACE_HAS_WINNT4) || (ACE_HAS_WINNT4 == 0)) - ACE_MEM_POOL_OPTIONS options (this->name_options_->base_address (), 0); -# else ACE_MEM_POOL_OPTIONS options (this->name_options_->base_address ()); -# endif /* !ACE_HAS_WINNT4 */ #else // Use base address == 0, don't use a fixed address. ACE_MEM_POOL_OPTIONS options (0, diff --git a/ace/Mem_Map.cpp b/ace/Mem_Map.cpp index 965f2f69216..7604d8a9b47 100644 --- a/ace/Mem_Map.cpp +++ b/ace/Mem_Map.cpp @@ -5,6 +5,15 @@ #include "ace/Mem_Map.h" #include "ace/Log_Msg.h" +#if defined (ACE_WIN32) \ + && (!defined(ACE_HAS_WINNT4) || (ACE_HAS_WINNT4 == 0)) +# define ACE_USE_MAPPING_NAME 1 +#endif /* ACE_WIN32 */ + +#if defined (ACE_USE_MAPPING_NAME) +#include "ace/SString.h" +#endif /* ACE_USE_MAPPING_NAME */ + #if !defined (__ACE_INLINE__) #include "ace/Mem_Map.i" #endif /* __ACE_INLINE__ */ @@ -13,6 +22,35 @@ ACE_RCSID(ace, Mem_Map, "$Id$") ACE_ALLOC_HOOK_DEFINE(ACE_Mem_Map) +#if defined (ACE_USE_MAPPING_NAME) +// Gets a mapping object name from a file name. TODO: The file name +// is used as the key to the mapping. We should try to avoid mapping +// the same object name to different files (there is a mapping object +// name length limitation). + +static void +to_mapping_name (ACE_TCHAR *mapobjname, + const ACE_TCHAR *filename, + size_t len) +{ + --len; + size_t i = 0; + + while (*filename && i < len) + { + if (*filename == ACE_LIB_TEXT ('\\')) + // Can't use backslash in mapping object name. + mapobjname[i] = ACE_LIB_TEXT ('.'); + else + mapobjname[i] = *filename; + ++filename; + ++i; + } + + mapobjname[i] = 0; +} +#endif /* ACE_USE_MAPPING_NAME */ + void ACE_Mem_Map::dump (void) const { @@ -157,14 +195,39 @@ ACE_Mem_Map::map_it (ACE_HANDLE handle, write_enabled_ = ACE_BIT_ENABLED (prot, PROT_WRITE); #endif /* __Lynx__ */ - this->base_addr_ = ACE_OS::mmap (this->base_addr_, - this->length_, - prot, - share, - this->handle_, - offset, - &this->file_mapping_, - sa); +#if defined (ACE_USE_MAPPING_NAME) + if (ACE_BIT_ENABLED (share, MAP_SHARED)) + { +# if defined(__MINGW32__) + const int max_mapping_name_length = 32; +# else + const int max_mapping_name_length = 31; +# endif /* __MINGW32__ */ + ACE_TCHAR file_mapping_name[max_mapping_name_length + 1]; + to_mapping_name (file_mapping_name, + filename_, + max_mapping_name_length + 1); + + this->base_addr_ = ACE_OS::mmap (this->base_addr_, + this->length_, + prot, + share, + this->handle_, + offset, + &this->file_mapping_, + sa, + file_mapping_name); + } + else +#endif /* ACE_USE_MAPPING_NAME */ + this->base_addr_ = ACE_OS::mmap (this->base_addr_, + this->length_, + prot, + share, + this->handle_, + offset, + &this->file_mapping_, + sa); return this->base_addr_ == MAP_FAILED ? -1 : 0; } @@ -5732,7 +5732,8 @@ public: ACE_HANDLE handle, off_t off = 0, ACE_HANDLE *file_mapping = 0, - LPSECURITY_ATTRIBUTES sa = 0); + LPSECURITY_ATTRIBUTES sa = 0, + const ACE_TCHAR *file_mapping_name = 0); static int mprotect (void *addr, size_t len, int prot); @@ -3226,9 +3226,14 @@ ACE_OS::mmap (void *addr, ACE_HANDLE file_handle, off_t off, ACE_HANDLE *file_mapping, - LPSECURITY_ATTRIBUTES sa) + LPSECURITY_ATTRIBUTES sa, + const ACE_TCHAR *file_mapping_name) { ACE_OS_TRACE ("ACE_OS::mmap"); +#if !defined (ACE_WIN32) || defined (ACE_HAS_PHARLAP) + ACE_UNUSED_ARG (file_mapping_name); +#endif /* !defined (ACE_WIN32) || defined (ACE_HAS_PHARLAP) */ + #if defined (ACE_HAS_PACE) && !defined (__Lynx__) && !defined (ACE_WIN32) ACE_UNUSED_ARG (file_mapping); ACE_UNUSED_ARG (sa); @@ -3263,12 +3268,38 @@ ACE_OS::mmap (void *addr, // Only create a new handle if we didn't have a valid one passed in. if (*file_mapping == ACE_INVALID_HANDLE) - *file_mapping = ::CreateFileMapping (file_handle, - ACE_OS::default_win32_security_attributes (sa), - prot, - 0, - 0, - 0); + { +#if !defined (ACE_HAS_WINNT4) || (ACE_HAS_WINNT4 == 0) + int try_create = 1; + if (file_mapping_name != 0) + { + // On Win9x, we first try to OpenFileMapping to + // file_mapping_name. Only if there is no mapping object + // with that name we try CreateFileMapping. + + *file_mapping = ACE_TEXT_OpenFileMapping (nt_flags, + 0, + file_mapping_name); + if (*file_mapping != 0 + || ::GetLastError () != ERROR_INVALID_NAME) + try_create = 0; + } + + if (try_create) +#endif /* (ACE_HAS_WINNT4) || (ACE_HAS_WINNT4 == 0) */ + { + const LPSECURITY_ATTRIBUTES attr = + ACE_OS::default_win32_security_attributes (sa); + + *file_mapping = ACE_TEXT_CreateFileMapping (file_handle, + attr, + prot, + 0, + 0, + file_mapping_name); + } + } + if (*file_mapping == 0) ACE_FAIL_RETURN (MAP_FAILED); diff --git a/ace/ace_wchar.h b/ace/ace_wchar.h index 2e46e5531ca..ee4cb770be6 100644 --- a/ace/ace_wchar.h +++ b/ace/ace_wchar.h @@ -85,11 +85,7 @@ using std::size_t; // Define the unicode/wchar related macros correctly # if !defined (ACE_TEXT_WIDE) -# if defined (VXWORKS) -# define ACE_TEXT_WIDE_I(STRING) STRING -# else /* VXWORKS */ # define ACE_TEXT_WIDE_I(STRING) L##STRING -#endif /* VXWORKS */ # define ACE_TEXT_WIDE(STRING) ACE_TEXT_WIDE_I (STRING) # endif /* ACE_TEXT_WIDE */ @@ -219,6 +215,7 @@ typedef ACE_Wide_To_Ascii ACE_OS_WString; #define ACE_TEXT_GetUserName ::GetUserNameW #define ACE_TEXT_LoadLibrary ::LoadLibraryW #define ACE_TEXT_MoveFileEx ::MoveFileExW +#define ACE_TEXT_OpenFileMapping ::OpenFileMappingW #define ACE_TEXT_OpenSCManager ::OpenSCManagerW #define ACE_TEXT_OpenService ::OpenServiceW #define ACE_TEXT_RegisterEventSource ::RegisterEventSourceW @@ -263,6 +260,7 @@ typedef ACE_Wide_To_Ascii ACE_OS_WString; #define ACE_TEXT_GetUserName ::GetUserNameA #define ACE_TEXT_LoadLibrary ::LoadLibraryA #define ACE_TEXT_MoveFileEx ::MoveFileExA +#define ACE_TEXT_OpenFileMapping ::OpenFileMappingA #define ACE_TEXT_OpenSCManager ::OpenSCManagerA #define ACE_TEXT_OpenService ::OpenServiceA #define ACE_TEXT_RegisterEventSource ::RegisterEventSourceA diff --git a/tests/MEM_Stream_Test.cpp b/tests/MEM_Stream_Test.cpp index 475c3422a03..09928a66cc5 100644 --- a/tests/MEM_Stream_Test.cpp +++ b/tests/MEM_Stream_Test.cpp @@ -97,7 +97,7 @@ Echo_Handler::handle_input (ACE_HANDLE) ACE_TCHAR buf[MAXPATHLEN]; ssize_t len; - len = this->peer ().recv (buf, MAXPATHLEN); + len = this->peer ().recv (buf, MAXPATHLEN * sizeof (ACE_CHAR)); if (len == -1) ACE_ERROR_RETURN ((LM_ERROR, diff --git a/tests/Malloc_Test.cpp b/tests/Malloc_Test.cpp index 8117343b002..93b2800c0e5 100644 --- a/tests/Malloc_Test.cpp +++ b/tests/Malloc_Test.cpp @@ -37,12 +37,16 @@ typedef ACE_Malloc<ACE_MMAP_MEMORY_POOL, ACE_Process_Mutex> MALLOC; #define MMAP_FILENAME ACE_TEXT ("test_file") #define MUTEX_NAME ACE_TEXT ("test_lock") -#if !defined (linux) && \ - !(defined (ACE_WIN32) && (defined (ghs) || defined (__MINGW32__))) +#if !defined (linux) \ + && !(defined (ACE_WIN32) \ + && (defined (ghs) \ + || defined (__MINGW32__) \ + || (!defined(ACE_HAS_WINNT4) || (ACE_HAS_WINNT4 == 0)))) #define ACE_TEST_REMAP_ON_FAULT // Linux seems to have problem when calling mmap from the signal handler. // The Green Hills Native x86 compiler does not support structural exceptions. // Mingw's gcc does not support structural exceptions. +// Win9x doesn't support remaps. // On these plarforms, we make sure the remapping will never occur. #endif /* linux && Win32 GHS*/ @@ -62,15 +66,21 @@ static const void *PARENT_BASE_ADDR = ACE_DEFAULT_BASE_ADDR; // If the platform supports position-independent malloc, choose // another base address that's 1M higher so that <ACE_Malloc> will be // mapped into a different address in the child's virtual memory. -// Note that on HP-UX on PA-RISC hardware, a single range of a file cannot -// be mapped into multiple virtual address ranges, even across processes. -// So, though the whole PI pointer thing is tested here, it isn't actually -// using multiple address ranges. -static const void *CHILD_BASE_ADDR = -#if (ACE_HAS_POSITION_INDEPENDENT_POINTERS == 1 && !defined (HPUX)) - 1024 * 1024 + -#endif /* ACE_HAS_POSITION_INDEPENDENT_POINTERS == 1 */ - ACE_DEFAULT_BASE_ADDR; +// Note that on HP-UX on PA-RISC hardware, a single range of a file +// cannot be mapped into multiple virtual address ranges, even across +// processes. So, though the whole PI pointer thing is tested here, +// it isn't actually using multiple address ranges. Also, on Win9x, +// you need to map shared views to the same address. + +#if (ACE_HAS_POSITION_INDEPENDENT_POINTERS == 1 && !defined (HPUX)) \ + && !(defined (ACE_WIN32) \ + && (!defined (ACE_HAS_WINNT4) || (ACE_HAS_WINNT4 == 0))) +# define CHILD_ADDR_DELTA (1024*1024) +#else +# define CHILD_ADDR_DELTA 0 +#endif /* CHILD_ADDR_DELTA */ + +static const void *CHILD_BASE_ADDR = CHILD_ADDR_DELTA + ACE_DEFAULT_BASE_ADDR; // Shared memory allocator. Hide the allocator inside this function // so that it doesn't get constructed until after the @@ -282,30 +292,25 @@ child (void) // On Win9x/Me, a shared address needs to be on the shared arena, // betweeen the second and third megabyte in the virtual address space // of the process. Also, a mapped view of a file is shared on the same -// virtual address on every 32 bit process. -// On WinNT/2k, memory above 2Gb is reserved for the system. -// So, we need to check at runtime (we want an ACE_HAS_WINNT4 == 0 ace -// to run on either). +// virtual address on every 32 bit process. On WinNT/2k, memory above +// 2Gb is reserved for the system. So, we need to check at runtime +// (we want an ACE_HAS_WINNT4 == 0 ace to run on either). static void -get_base_addrs() +get_base_addrs (void) { OSVERSIONINFO vinfo; - vinfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + vinfo.dwOSVersionInfoSize = sizeof (OSVERSIONINFO); if (::GetVersionEx(&vinfo) == 0) return; if (vinfo.dwPlatformId == VER_PLATFORM_WIN32_NT) - { - PARENT_BASE_ADDR = (char*) (64 * 1024*1024); - } + PARENT_BASE_ADDR = (char*) (64 * 1024*1024); else - { - PARENT_BASE_ADDR = (char*) ((2048UL + 512UL)*(1024UL*1024UL)); - } + PARENT_BASE_ADDR = (char*) ((2048UL + 512UL)*(1024UL*1024UL)); - CHILD_BASE_ADDR = 1024*1024 + (char*) PARENT_BASE_ADDR; + CHILD_BASE_ADDR = CHILD_ADDR_DELTA + (char*) PARENT_BASE_ADDR; } -#endif +#endif /* defined (ACE_WIN32) && (!defined (ACE_HAS_WINNT4) || (ACE_HAS_WINNT4 == 0)) */ int main (int argc, ACE_TCHAR *[]) |