Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/Compiler/Utilities/FileSystem.fs
Original file line number Diff line number Diff line change
Expand Up @@ -530,8 +530,6 @@ type DefaultFileSystem() as this =

// We want to use mmaped files only when:
// - Opening large binary files (no need to use for source or resource files really)
// - Running on mono, since its MemoryMappedFile implementation throws when "mapName" is not provided (is null).
// (See: https://github.com/mono/mono/issues/10245)

if not useMemoryMappedFile then
fileStream :> Stream
Expand All @@ -542,12 +540,12 @@ type DefaultFileSystem() as this =
MemoryMappedFile.CreateNew(
null,
length,
MemoryMappedFileAccess.Read,
MemoryMappedFileAccess.ReadWrite,
MemoryMappedFileOptions.None,
HandleInheritability.None
)

use stream = mmf.CreateViewStream(0L, length, MemoryMappedFileAccess.Read)
use stream = mmf.CreateViewStream(0L, length, MemoryMappedFileAccess.ReadWrite)
fileStream.CopyTo(stream)
fileStream.Dispose()
mmf
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[<EntryPoint>] let main _ = 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
</PropertyGroup>

<PropertyGroup>
<DotnetFscCompilerPath>$(MSBuildThisFileDirectory)../../../artifacts/bin/fsc/Debug/net6.0/fsc.dll</DotnetFscCompilerPath>
<Fsc_DotNET_DotnetFscCompilerPath>$(MSBuildThisFileDirectory)../../../artifacts/bin/fsc/Debug/net6.0/fsc.dll</Fsc_DotNET_DotnetFscCompilerPath>
<FSharpPreferNetFrameworkTools>False</FSharpPreferNetFrameworkTools>
<FSharpPrefer64BitTools>True</FSharpPrefer64BitTools>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FSharp.Core" Version="3.0.2" />
</ItemGroup>

<ItemGroup>
<Compile Include="Program.fs" />
</ItemGroup>

</Project>