2010-04-14 Jb Evain <jbevain@novell.com>
authorJb Evain <jbevain@gmail.com>
Wed, 14 Apr 2010 16:38:53 +0000 (16:38 -0000)
committerJb Evain <jbevain@gmail.com>
Wed, 14 Apr 2010 16:38:53 +0000 (16:38 -0000)
* MemoryMappedViewAccessor.cs
* MemoryMappedFile.cs
* MemoryMappedViewStream.cs:
Properly retrieve the size of the mmapped file. Fixes the
unit tests.

svn path=/trunk/mcs/; revision=155407

mcs/class/System.Core/System.IO.MemoryMappedFiles/ChangeLog
mcs/class/System.Core/System.IO.MemoryMappedFiles/MemoryMappedFile.cs
mcs/class/System.Core/System.IO.MemoryMappedFiles/MemoryMappedViewAccessor.cs
mcs/class/System.Core/System.IO.MemoryMappedFiles/MemoryMappedViewStream.cs

index 1466f2eb6cc416841092a6110878900f534888a4..bbe1e4b0704f633f251c4c2f31d34227b60b8e20 100644 (file)
@@ -1,3 +1,11 @@
+2010-04-14  Jb Evain  <jbevain@novell.com>
+
+       * MemoryMappedViewAccessor.cs
+       * MemoryMappedFile.cs
+       * MemoryMappedViewStream.cs:
+               Properly retrieve the size of the mmapped file. Fixes the
+               unit tests.
+
 2009-12-14  Miguel de Icaza  <miguel@novell.com>
 
        * MemoryMappedFile.cs: Make this by default use the native
index 7376bc5ae0628a357bac38f7b663867715b8ecd2..6c2f168c444311ee5112b6148b3eafe5872c80c0 100644 (file)
@@ -333,7 +333,7 @@ namespace System.IO.MemoryMappedFiles
                        }
                }
 
-               internal static unsafe void MapPosix (int file_handle, long offset, long size, MemoryMappedFileAccess access, out IntPtr map_addr, out int offset_diff)
+               internal static unsafe void MapPosix (int file_handle, long offset, ref long size, MemoryMappedFileAccess access, out IntPtr map_addr, out int offset_diff)
                {
                        if (pagesize == 0)
                                pagesize = Syscall.getpagesize ();
index e1fc156c2a36f133dafe22c7e30c2afdd9c4e823..ae9b4541575507cd3b5121331a9ae7ca79e69477 100644 (file)
@@ -73,7 +73,7 @@ namespace System.IO.MemoryMappedFiles
                {
                        int offset_diff;
 
-                       MemoryMappedFile.MapPosix (file_handle, offset, size, access, out mmap_addr, out offset_diff);
+                       MemoryMappedFile.MapPosix (file_handle, offset, ref size, access, out mmap_addr, out offset_diff);
 
                        handle = new SafeMemoryMappedViewHandle ((IntPtr)((long)mmap_addr + offset_diff), size);
                        Initialize (handle, 0, size, ToFileAccess (access));
index 2bf2f8a0084fde6f1d5c9ff8daf2f7fad7b39d97..f68a1051843ee5dbb20989284702fd8ed3e5435c 100644 (file)
@@ -53,8 +53,7 @@ namespace System.IO.MemoryMappedFiles
                {
                        int offset_diff;
                        mmap_size = (ulong) size;
-                       MemoryMappedFile.MapPosix (fd, offset, size, access, out mmap_addr, out offset_diff);
-                       
+                       MemoryMappedFile.MapPosix (fd, offset, ref size, access, out mmap_addr, out offset_diff);
                        FileAccess faccess;
 
                        switch (access) {