Delete RtlMoveMemory and tests (#22668)
authorAdeel Mujahid <adeelbm@outlook.com>
Mon, 18 Feb 2019 04:29:23 +0000 (06:29 +0200)
committerJan Kotas <jkotas@microsoft.com>
Mon, 18 Feb 2019 04:29:23 +0000 (20:29 -0800)
17 files changed:
src/pal/inc/pal.h
src/pal/src/memory/heap.cpp
src/pal/tests/palsuite/filemapping_memmgt/CMakeLists.txt
src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/CMakeLists.txt [deleted file]
src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test1/CMakeLists.txt [deleted file]
src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test1/test1.cpp [deleted file]
src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test1/testinfo.dat [deleted file]
src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test3/CMakeLists.txt [deleted file]
src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test3/test3.cpp [deleted file]
src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test3/testinfo.dat [deleted file]
src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test4/CMakeLists.txt [deleted file]
src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test4/test4.cpp [deleted file]
src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test4/testinfo.dat [deleted file]
src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test5/CMakeLists.txt [deleted file]
src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test5/test5.cpp [deleted file]
src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test5/testinfo.dat [deleted file]
src/pal/tests/palsuite/paltestlist.txt

index 0357464..20befc9 100644 (file)
@@ -2827,20 +2827,11 @@ VirtualQuery(
          OUT PMEMORY_BASIC_INFORMATION lpBuffer,
          IN SIZE_T dwLength);
 
-PALIMPORT
-VOID
-PALAPI
-RtlMoveMemory(
-          IN PVOID Destination,
-          IN CONST VOID *Source,
-          IN SIZE_T Length);
-
 #define MoveMemory memmove
 #define CopyMemory memcpy
 #define FillMemory(Destination,Length,Fill) memset((Destination),(Fill),(Length))
 #define ZeroMemory(Destination,Length) memset((Destination),0,(Length))
 
-
 PALIMPORT
 HANDLE
 PALAPI
index ccee77f..42681bc 100644 (file)
@@ -40,29 +40,6 @@ SET_DEFAULT_DEBUG_CHANNEL(MEM);
 
 /*++
 Function:
-  RtlMoveMemory
-
-See MSDN doc.
---*/
-VOID
-PALAPI
-RtlMoveMemory(
-          IN PVOID Destination,
-          IN CONST VOID *Source,
-          IN SIZE_T Length)
-{
-    PERF_ENTRY(RtlMoveMemory);
-    ENTRY("RtlMoveMemory(Destination:%p, Source:%p, Length:%d)\n", 
-          Destination, Source, Length);
-    
-    memmove(Destination, Source, Length);
-    
-    LOGEXIT("RtlMoveMemory returning\n");
-    PERF_EXIT(RtlMoveMemory);
-}
-
-/*++
-Function:
   HeapCreate
 
 See MSDN doc.
index 4f996bd..a0f1eb8 100644 (file)
@@ -17,10 +17,8 @@ add_subdirectory(MapViewOfFile)
 add_subdirectory(OpenFileMappingA)
 add_subdirectory(OpenFileMappingW)
 add_subdirectory(ProbeMemory)
-add_subdirectory(RtlMoveMemory)
 add_subdirectory(UnmapViewOfFile)
 add_subdirectory(VirtualAlloc)
 add_subdirectory(VirtualFree)
 add_subdirectory(VirtualProtect)
 add_subdirectory(VirtualQuery)
-
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/CMakeLists.txt
deleted file mode 100644 (file)
index 393074b..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-add_subdirectory(test1)
-add_subdirectory(test3)
-add_subdirectory(test4)
-add_subdirectory(test5)
-
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test1/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test1/CMakeLists.txt
deleted file mode 100644 (file)
index 12aba80..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
-  test1.cpp
-)
-
-add_executable(paltest_rtlmovememory_test1
-  ${SOURCES}
-)
-
-add_dependencies(paltest_rtlmovememory_test1 coreclrpal)
-
-target_link_libraries(paltest_rtlmovememory_test1
-  ${COMMON_TEST_LIBRARIES}
-)
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test1/test1.cpp b/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test1/test1.cpp
deleted file mode 100644 (file)
index 7fc5651..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=============================================================
-**
-** Source: test1.c
-**
-** Purpose: Simple test -- have two 128 blocks of memory allocated.  Then
-** move one block to the other and check to see that the data was not
-** corrupted.
-**
-**
-**============================================================*/
-
-#include <palsuite.h>
-
-enum Memory 
-{
-    MEMORY_AMOUNT = 128
-};
-
-int __cdecl main(int argc, char *argv[])
-{
-    char NewAddress[MEMORY_AMOUNT];
-    char OldAddress[MEMORY_AMOUNT];
-    int i;
-    char temp;
-    
-    if(PAL_Initialize(argc, argv))
-    {
-        return FAIL;
-    }
-
-    /* Put some data into the block we'll be moving */
-    memset(OldAddress, 'X', MEMORY_AMOUNT);
-
-    /* Move the block to the NewAddress */
-    RtlMoveMemory(NewAddress, OldAddress, MEMORY_AMOUNT);
-
-    /* Check to ensure the data didn't get corrupted */
-    for(i=0; i<MEMORY_AMOUNT; ++i)
-    {
-        if(NewAddress[i] != 'X')
-        {
-            temp = NewAddress[i];
-            Fail("ERROR: When the memory was moved to a new location, the "
-                 "data which was stored in it was somehow corrupted.  "
-                 "Character %d should have been 'X' but instead is %c.\n",
-                 i, temp);
-        }
-    }
-  
-    PAL_Terminate();
-    return PASS;
-}
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test1/testinfo.dat b/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test1/testinfo.dat
deleted file mode 100644 (file)
index 645d46c..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = Filemapping_memmgt
-Function = RtlMoveMemory
-Name = Positive test for RtlMoveMemory API
-TYPE = DEFAULT
-EXE1 = test1
-Description
-= Simple test -- have two 128 blocks of memory allocated.  Then
-= move one block to the other and check to see that the data was not
-= corrupted.
-
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test3/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test3/CMakeLists.txt
deleted file mode 100644 (file)
index 3773cb7..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
-  test3.cpp
-)
-
-add_executable(paltest_rtlmovememory_test3
-  ${SOURCES}
-)
-
-add_dependencies(paltest_rtlmovememory_test3 coreclrpal)
-
-target_link_libraries(paltest_rtlmovememory_test3
-  ${COMMON_TEST_LIBRARIES}
-)
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test3/test3.cpp b/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test3/test3.cpp
deleted file mode 100644 (file)
index 279c0c1..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=============================================================
-**
-** Source: test3.c
-**
-** Purpose: Allocate 128 bytes of memory and store data in it.  Move 10
-** other bytes of memory to that location. Check that the first 10 bytes
-** carried over their data and that the other 118 were unchanged.
-**
-**
-**============================================================*/
-
-#include <palsuite.h>
-
-enum Memory
-{
-    NEW_MEMORY_AMOUNT = 128,
-    OLD_MEMORY_AMOUNT = 10
-};
-
-int __cdecl main(int argc, char *argv[])
-{
-    char NewAddress[NEW_MEMORY_AMOUNT];
-    char OldAddress[OLD_MEMORY_AMOUNT];
-    int i;
-
-    
-    if(PAL_Initialize(argc, argv))
-    {
-        return FAIL;
-    }
-
-    /* Put some data into the block we'll be moving */
-    memset(OldAddress, 'X', OLD_MEMORY_AMOUNT);
-
-    /* Put some data into the block we're moving to */
-    memset(NewAddress, 'Z', NEW_MEMORY_AMOUNT);
-
-    /* Move the block to the NewAddress */
-    RtlMoveMemory(NewAddress, OldAddress, OLD_MEMORY_AMOUNT);
-
-    /* Check to ensure the moved data didn't get corrupted */
-    for(i=0; i<OLD_MEMORY_AMOUNT; ++i)
-    {
-        if(NewAddress[i] != 'X')
-        {
-            Fail("ERROR: When the memory was moved to a new location, the "
-                 "data which was stored in it was somehow corrupted.  "
-                 "Character %d should have been 'X' but instead is %c.\n",
-                 i, NewAddress[i]);
-        }
-    }
-    
-    /* Check to ensure the memory which didn't move didn't get corrupted */
-    for(i=OLD_MEMORY_AMOUNT; i<NEW_MEMORY_AMOUNT; ++i)
-    {
-        if(NewAddress[i] != 'Z')
-        {
-            Fail("ERROR: When the memory was moved to a new location, the "
-                 "data which was stored in it was somehow corrupted.  "
-                 "Character %d should have been 'Z' but instead is %c.\n",
-                 i, NewAddress[i]);
-        }
-    }
-
-  
-    PAL_Terminate();
-    return PASS;
-}
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test3/testinfo.dat b/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test3/testinfo.dat
deleted file mode 100644 (file)
index fb56f2e..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = Filemapping_memmgt
-Function = RtlMoveMemory
-Name = Positive test for RtlMoveMemory API, move a small block to large
-TYPE = DEFAULT
-EXE1 = test3
-Description
-= Allocate 128 bytes of memory and store data in it.  Move 10
-= other bytes of memory to that location. Check that the first 10 bytes
-= carried over their data and that the other 118 were unchanged.
-
-
-
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test4/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test4/CMakeLists.txt
deleted file mode 100644 (file)
index 0b4414b..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
-  test4.cpp
-)
-
-add_executable(paltest_rtlmovememory_test4
-  ${SOURCES}
-)
-
-add_dependencies(paltest_rtlmovememory_test4 coreclrpal)
-
-target_link_libraries(paltest_rtlmovememory_test4
-  ${COMMON_TEST_LIBRARIES}
-)
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test4/test4.cpp b/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test4/test4.cpp
deleted file mode 100644 (file)
index b6e1ecd..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=============================================================
-**
-** Source: test4.c
-**
-** Purpose: Test simple overlapping.  Move the first 50 bytes of a 
-** piece of memory to the latter 50 bytes.  ie i -> i+50 Check to make sure
-** no data is lost.
-**
-**
-**============================================================*/
-
-#include <palsuite.h>
-
-enum Memory 
-{
-    MEMORY_AMOUNT = 128
-};
-
-int __cdecl main(int argc, char *argv[])
-{
-    char* NewAddress;
-    char OldAddress[MEMORY_AMOUNT];
-    int i;
-    
-    if(PAL_Initialize(argc, argv))
-    {
-        return FAIL;
-    }
-    
-    NewAddress = OldAddress+50;
-
-    /* Put some data into the block we'll be moving 
-       The first 50 byes will be 'X' and the rest set to 'Z'
-    */
-    memset(OldAddress, 'X', 50);
-    memset(NewAddress, 'Z', MEMORY_AMOUNT-50);  
-
-    /* Move the first 50 bytes of OldAddress to OldAddress+50.  This
-       is to test that the source and destination addresses can overlap.
-    */
-    RtlMoveMemory(NewAddress, OldAddress, 50);
-
-    /* Check to ensure the moved data didn't get corrupted 
-       The first 50 bytes should be 'X'
-    */
-    for(i=0; i<50; ++i)
-    {
-        if(NewAddress[i] != 'X')
-        {
-            Fail("ERROR: When the memory was moved to a new location, the "
-                 "data which was stored in it was somehow corrupted.  "
-                 "Character %d should have been 'X' but instead is %c.\n",
-                 i, NewAddress[i]);
-        }
-    }
-
-    /* The rest of the memory should be 'Z' */
-    for(i=50; i<MEMORY_AMOUNT-50; ++i)
-    {
-        if(NewAddress[i] != 'Z')
-        {
-
-            Fail("ERROR: When the memory was moved to a new location, the "
-                 "data which was stored in it was somehow corrupted.  "
-                 "Character %d should have been 'Z' but instead is %c.\n",
-                 i, NewAddress[i]);
-        }
-    }
-  
-    PAL_Terminate();
-    return PASS;
-}
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test4/testinfo.dat b/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test4/testinfo.dat
deleted file mode 100644 (file)
index 56b82f2..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = Filemapping_memmgt
-Function = RtlMoveMemory
-Name = Positive test for RtlMoveMemory API, test that overlapping works
-TYPE = DEFAULT
-EXE1 = test4
-Description
-= Test simple overlapping.  Move the first 50 bytes of a 
-= piece of memory to the latter 50 bytes.  ie i -> i+50 Check to make sure
-= no data is lost.
-
-
-
-
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test5/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test5/CMakeLists.txt
deleted file mode 100644 (file)
index f3c38f2..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
-  test5.cpp
-)
-
-add_executable(paltest_rtlmovememory_test5
-  ${SOURCES}
-)
-
-add_dependencies(paltest_rtlmovememory_test5 coreclrpal)
-
-target_link_libraries(paltest_rtlmovememory_test5
-  ${COMMON_TEST_LIBRARIES}
-)
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test5/test5.cpp b/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test5/test5.cpp
deleted file mode 100644 (file)
index affcb0a..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=============================================================
-**
-** Source: test5.c
-**
-** Purpose: Do more complex overlapping.  Move a section of memory back so
-** that it actually ends up overlapping itself.
-**
-**
-**============================================================*/
-
-#include <palsuite.h>
-
-enum Memory 
-{
-    MEMORY_AMOUNT = 128
-};
-
-int __cdecl main(int argc, char *argv[])
-{
-    char* NewAddress;
-    char* SectionToMove;
-    char TheMemory[MEMORY_AMOUNT];
-    int i;
-    
-    if(PAL_Initialize(argc, argv))
-    {
-        return FAIL;
-    }
-    
-    NewAddress = TheMemory;
-    SectionToMove = TheMemory+50;
-
-    /* Put some data into the first 50 bytes */
-    memset(TheMemory, 'X', 50);
-
-    /* Put some data into the rest of the memory */
-    memset(SectionToMove, 'Z', MEMORY_AMOUNT-50); 
-    /* Move the section in the middle of TheMemory back to the start of
-       TheMemory -- but have it also overlap itself.  (ie. the section
-       to be move is overlapping itself)
-    */
-    RtlMoveMemory(NewAddress, SectionToMove, MEMORY_AMOUNT-50);
-
-    /* Check to ensure the moved data didn't get corrupted     */
-    for(i=0; i<MEMORY_AMOUNT-50; ++i)
-    {
-        if(NewAddress[i] != 'Z')
-        {
-            Fail("ERROR: When the memory was moved to a new location, the "
-                 "data which was stored in it was somehow corrupted.  "
-                 "Character %d should have been 'Z' but instead is %c.\n",
-                 i, NewAddress[i]);
-        }
-    }
-  
-    PAL_Terminate();
-    return PASS;
-}
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test5/testinfo.dat b/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test5/testinfo.dat
deleted file mode 100644 (file)
index a4ba99a..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = Filemapping_memmgt
-Function = RtlMoveMemory
-Name = Positive test for RtlMoveMemory API, test that overlapping works
-TYPE = DEFAULT
-EXE1 = test5
-Description
-= Do more complex overlapping.  Move a section of memory back so
-= that it actually ends up overlapping itself.
-
-
-
-
-
index 4a75b67..ebc3592 100644 (file)
@@ -495,10 +495,6 @@ filemapping_memmgt/MapViewOfFile/test5/paltest_mapviewoffile_test5
 filemapping_memmgt/MapViewOfFile/test6/paltest_mapviewoffile_test6
 filemapping_memmgt/ProbeMemory/test1/paltest_probememory_test1
 filemapping_memmgt/ProbeMemory/ProbeMemory_neg1/paltest_probememory_probememory_neg1
-filemapping_memmgt/RtlMoveMemory/test1/paltest_rtlmovememory_test1
-filemapping_memmgt/RtlMoveMemory/test3/paltest_rtlmovememory_test3
-filemapping_memmgt/RtlMoveMemory/test4/paltest_rtlmovememory_test4
-filemapping_memmgt/RtlMoveMemory/test5/paltest_rtlmovememory_test5
 filemapping_memmgt/UnmapViewOfFile/test1/paltest_unmapviewoffile_test1
 filemapping_memmgt/UnmapViewOfFile/test2/paltest_unmapviewoffile_test2
 filemapping_memmgt/VirtualAlloc/test1/paltest_virtualalloc_test1