Memory-mapped files in Unity

Hey guys,

Do memory-mapped files work in Unity? Any known limitations if so?

1 Like

It isn’t so much a Unity question as it is up to the underlying operating system.

In Unity scripting you are in C# and can access native code via the usual C# interop calls.

3 Likes

yes I use them. they have been great for fast random access on insanely huge files.

projectsettings->player->api compatability level .NET 4.x

using System.IO.MemoryMappedFiles;

not sure of any cross platform limitations as I only work on windows currently, but would be good to know too.

3 Likes

Thanks buddies