Hi,
I need some help. I'm trying to test your Key/value store engine (v 4.0.8) for a new Social Network plateform writen un C# (large parts in unsafe code to use native memory to avoid GC pauses). But it doesn't work. As a Key for my tables, i'm using a simple struct. This struct is used as field type in various key types too. I've discover that structs are not supported, only classes are supported both as key and value.
My struct is the above :
[System.Runtime.InteropServices.StructLayout(LayoutKind.Explicit)]
public struct UOId : IFormattable, IComparable, IComparable<UOId>, IEquatable<UOId> {
public static int _STRING_LENGHT = 23;
private static int[] chrv = null;
private static object _locker;
private static UOId _baseId = new UOId();
private static ulong _incrementalId = 1;
[System.Runtime.InteropServices.FieldOffset(0)]
public ulong _objectId;
[System.Runtime.InteropServices.FieldOffset(6)]
public ushort _serverId;
[System.Runtime.InteropServices.FieldOffset(5)]
public byte _flags;
// -------- For encoding
[System.Runtime.InteropServices.FieldOffset(0)]
public byte _high;
[System.Runtime.InteropServices.FieldOffset(7)]
public byte _low;
....
You can see that the struct is an ulong over wich are wrapped some sub fields. It's a basic technic to build fast composed sortable identifiers.
At this time i'm blocked by this problem. Perhaps there is a simple technic to use this struct both as key and as field type in various classes used as key ?
Thank you.