diff options
Diffstat (limited to 'ACE/tests/Malloc_Test.cpp')
-rw-r--r-- | ACE/tests/Malloc_Test.cpp | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/ACE/tests/Malloc_Test.cpp b/ACE/tests/Malloc_Test.cpp index 5b260a680a0..88c2bd5e669 100644 --- a/ACE/tests/Malloc_Test.cpp +++ b/ACE/tests/Malloc_Test.cpp @@ -44,7 +44,9 @@ typedef ACE_Malloc<ACE_MMAP_MEMORY_POOL, ACE_Process_Mutex> MALLOC; #if !defined (linux) && !defined (ACE_OPENVMS) \ && !(defined (ACE_WIN32) \ - && (defined (ghs) || defined (__MINGW32__) )) \ + && (defined (ghs) \ + || defined (__MINGW32__) \ + || (!defined(ACE_HAS_WINNT4) || (ACE_HAS_WINNT4 == 0)))) \ && !(defined (__OpenBSD__) && defined (ACE_HAS_PTHREADS)) #define ACE_TEST_REMAP_ON_FAULT // Linux seems to have problem when calling mmap from the signal handler. @@ -74,9 +76,12 @@ static const void *PARENT_BASE_ADDR = 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. +// 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)) +#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 @@ -302,16 +307,14 @@ child (void) return 0; } -#if defined (ACE_WIN32) +#if defined (ACE_WIN32) \ + && (!defined (ACE_HAS_WINNT4) || (ACE_HAS_WINNT4 == 0)) // 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). -// To catch any odd case arising from Pharlap and/or WinCE, do the -// run time check and run the NT4-or-better code unless we're on -// CE or something other than NT4 (Pharlap reports itself as NT 3.51). static void get_base_addrs (void) { @@ -320,20 +323,20 @@ get_base_addrs (void) if (::GetVersionEx(&vinfo) == 0) return; - if (vinfo.dwPlatformId == VER_PLATFORM_WIN32_NT && - vinfo.dwMajorVersion >= 4) + if (vinfo.dwPlatformId == VER_PLATFORM_WIN32_NT) PARENT_BASE_ADDR = (char*) (64 * 1024*1024); else PARENT_BASE_ADDR = (char*) ((2048UL + 512UL)*(1024UL*1024UL)); CHILD_BASE_ADDR = CHILD_ADDR_DELTA + (char*) PARENT_BASE_ADDR; } -#endif /* defined (ACE_WIN32) */ +#endif /* defined (ACE_WIN32) && (!defined (ACE_HAS_WINNT4) || (ACE_HAS_WINNT4 == 0)) */ int run_main (int argc, ACE_TCHAR *[]) { -#if defined (ACE_WIN32) +#if defined (ACE_WIN32) \ + && (!defined (ACE_HAS_WINNT4) || (ACE_HAS_WINNT4 == 0)) get_base_addrs(); #endif |