diff options
author | Aditya Mandaleeka <adityam@microsoft.com> | 2015-11-03 19:18:32 -0800 |
---|---|---|
committer | Aditya Mandaleeka <adityam@microsoft.com> | 2015-11-04 12:55:05 -0800 |
commit | 000393731777f3b7a08097a07aeed6c46b1ced00 (patch) | |
tree | 82f7f5fa78735b492f8d6aece18f14336b1823b3 /src/pal/src/map | |
parent | 60b3af370a3f27268fa2803603d5f8b9ee07ff82 (diff) | |
download | coreclr-000393731777f3b7a08097a07aeed6c46b1ced00.tar.gz coreclr-000393731777f3b7a08097a07aeed6c46b1ced00.tar.bz2 coreclr-000393731777f3b7a08097a07aeed6c46b1ced00.zip |
Remove thread parameter from virtual memory functions in PAL
Diffstat (limited to 'src/pal/src/map')
-rw-r--r-- | src/pal/src/map/virtual.cpp | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/src/pal/src/map/virtual.cpp b/src/pal/src/map/virtual.cpp index 1e38526eb4..0a9e773d0d 100644 --- a/src/pal/src/map/virtual.cpp +++ b/src/pal/src/map/virtual.cpp @@ -67,8 +67,8 @@ static FREE_BLOCK *pFreeMemory; // Currently 1GB. static const int BACKING_FILE_SIZE = 1024 * 1024 * 1024; -static void *VIRTUALReserveFromBackingFile(CPalThread *pthrCurrnet, UINT_PTR addr, size_t length); -static BOOL VIRTUALAddToFreeList(CPalThread* pthrCurrent, const PCMI pMemoryToBeReleased); +static void *VIRTUALReserveFromBackingFile(UINT_PTR addr, size_t length); +static BOOL VIRTUALAddToFreeList(const PCMI pMemoryToBeReleased); // The base address of the pages mapped onto our backing file. static void *gBackingBaseAddress = MAP_FAILED; @@ -565,7 +565,7 @@ Function : Returns true on success. FALSE otherwise. --*/ -static BOOL VIRTUALReleaseMemory( CPalThread *pthrCurrent, PCMI pMemoryToBeReleased ) +static BOOL VIRTUALReleaseMemory( PCMI pMemoryToBeReleased ) { BOOL bRetVal = TRUE; @@ -575,7 +575,6 @@ static BOOL VIRTUALReleaseMemory( CPalThread *pthrCurrent, PCMI pMemoryToBeRelea return FALSE; } - if ( pMemoryToBeReleased == pVirtualMemory ) { /* This is either the first entry, or the only entry. */ @@ -602,7 +601,7 @@ static BOOL VIRTUALReleaseMemory( CPalThread *pthrCurrent, PCMI pMemoryToBeRelea #if MMAP_IGNORES_HINT // We've removed the block from our allocated list. Add it to the // free list. - bRetVal = VIRTUALAddToFreeList(pthrCurrent, pMemoryToBeReleased); + bRetVal = VIRTUALAddToFreeList(pMemoryToBeReleased); #endif // MMAP_IGNORES_HINT InternalFree( pMemoryToBeReleased->pAllocState ); @@ -759,7 +758,6 @@ static void VIRTUALDisplayList( void ) * NOTE: The caller must own the critical section. */ static BOOL VIRTUALStoreAllocationInfo( - IN CPalThread *pthrCurrent, /* Currently executing thread */ IN UINT_PTR startBoundary, /* Start of the region. */ IN SIZE_T memSize, /* Size of the region. */ IN DWORD flAllocationType, /* Allocation Types. */ @@ -913,7 +911,7 @@ static LPVOID VIRTUALReserveMemory( InternalEnterCriticalSection(pthrCurrent, &virtual_critsec); #if MMAP_IGNORES_HINT - pRetVal = VIRTUALReserveFromBackingFile(pthrCurrent, StartBoundary, MemSize); + pRetVal = VIRTUALReserveFromBackingFile(StartBoundary, MemSize); #else // MMAP_IGNORES_HINT // Most platforms will only commit the memory if it is dirtied, // so this should not consume too much swap space. @@ -980,7 +978,7 @@ static LPVOID VIRTUALReserveMemory( #if !MMAP_IGNORES_HINT } #endif // MMAP_IGNORES_HINT - if ( !VIRTUALStoreAllocationInfo( pthrCurrent, StartBoundary, MemSize, + if ( !VIRTUALStoreAllocationInfo( StartBoundary, MemSize, flAllocationType, flProtect ) ) { ASSERT( "Unable to store the structure in the list.\n"); @@ -1219,7 +1217,7 @@ error: #else // MMAP_IGNORES_HINT && !MMAP_DOESNOT_ALLOW_REMAP munmap( pRetVal, MemSize ); #endif // MMAP_IGNORES_HINT && !MMAP_DOESNOT_ALLOW_REMAP - if ( VIRTUALReleaseMemory( pthrCurrent, pInformation ) == FALSE ) + if ( VIRTUALReleaseMemory( pInformation ) == FALSE ) { ASSERT( "Unable to remove the PCMI entry from the list.\n" ); pthrCurrent->SetLastError( ERROR_INTERNAL_ERROR ); @@ -1260,7 +1258,7 @@ Function: Returns the base address of the mapped block, or MAP_FAILED if no suitable block exists or mapping fails. --*/ -static void *VIRTUALReserveFromBackingFile(CPalThread *pthrCurrent, UINT_PTR addr, size_t length) +static void *VIRTUALReserveFromBackingFile(UINT_PTR addr, size_t length) { FREE_BLOCK *block; FREE_BLOCK *prev; @@ -1366,7 +1364,7 @@ Function: Returns TRUE if the block was added to the free list. --*/ -static BOOL VIRTUALAddToFreeList(CPalThread* pthrCurrent, const PCMI pMemoryToBeReleased) +static BOOL VIRTUALAddToFreeList(const PCMI pMemoryToBeReleased) { FREE_BLOCK *temp; FREE_BLOCK *lastBlock; @@ -1505,7 +1503,7 @@ static BOOL VIRTUALGetBackingFile(CPalThread *pthrCurrent) ASSERT("Surprisingly, LibRotorPal can't be found!"); goto done; } - gBackingFile = InternalOpen(pthrCurrent, palName, O_RDONLY); + gBackingFile = InternalOpen(palName, O_RDONLY); if (gBackingFile == -1) { ASSERT("Failed to open %s as a backing file: errno=%d\n", @@ -1824,7 +1822,7 @@ VirtualFree( pMemoryToBeReleased->memSize ) == 0 ) #endif // MMAP_IGNORES_HINT && !MMAP_DOESNOT_ALLOW_REMAP { - if ( VIRTUALReleaseMemory( pthrCurrent, pMemoryToBeReleased ) == FALSE ) + if ( VIRTUALReleaseMemory( pMemoryToBeReleased ) == FALSE ) { ASSERT( "Unable to remove the PCMI entry from the list.\n" ); pthrCurrent->SetLastError( ERROR_INTERNAL_ERROR ); |