Repository navigation
MasterMemory 4.0.0 is now available on NuGet. It is built on MessagePack for C# v4, which was released today.
The database binary format is unchanged: v4 reads a database built by v3. The basic API is kept, with some breaking changes. See the README for everything v4 does, and v3 -> v4 migration for what changed and how to fix it.
What's new
- Compatible with trimming and Native AOT, and no serializer setup is needed for IL2CPP.
MemoryDatabaseOptionsholds string interning, the formatter factory and compression in one reusable object.- LZ4 is opt-in through
MessagePack.LZ4. Nothing is compressed by default. - Lookups and table construction are faster.
RangeView<T>hasAsSpan()and an allocation-freeforeach. Its reverse isReverseRangeView<T>.- A composite key is passed member by member, and its leading part can be queried on its own (
FindByGenderfor a(Gender, Age)key). ImmutableBuilderis merged intoDatabaseBuilder(ToDatabaseBuilder,AddOrReplace,ToMemoryDatabase).MemoryDatabasereads frombyte[],ReadOnlyMemory<byte>andReadOnlySpan<byte>.- Keys can be declared in a base class, in another part of a partial class, or on a positional record parameter.
- Invalid table definitions are reported as errors (
MAM004toMAM011) instead of generating nothing.
Fixed issues
- #99: a database over 1 GB can be built, and one over 2 GB is refused with a clear error.
- #102: enum keys are compared by their underlying value, without boxing.
- #108: tables with the same class name in different namespaces are reported as error
MAM004. - #109: generated code uses fully qualified type names, so
usingdirectives inside#ifwork. - #115: the generated
MemoryDatabaseis nowpartial, so queries across tables can be added to it.
Verified on
.NET 9, .NET 8 (netstandard2.1), .NET Framework 4.8 (netstandard2.0), Native AOT, and Unity 2022.3.12f1 (editor and IL2CPP).