Skip to content

Commit

Permalink
minor adds
Browse files Browse the repository at this point in the history
  • Loading branch information
badrishc committed Oct 10, 2021
1 parent ffe14a0 commit 03af7ca
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
10 changes: 8 additions & 2 deletions cs/src/core/Allocator/GenericAllocator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,19 @@ public GenericAllocator(LogSettings settings, SerializerSettings<Key, Value> ser

if ((!keyBlittable) && (settings.LogDevice as NullDevice == null) && ((SerializerSettings == null) || (SerializerSettings.keySerializer == null)))
{
Debug.WriteLine("Key is not blittable, but no serializer specified via SerializerSettings. Using (slow) DataContractSerializer as default.");
#if DEBUG
if (typeof(Key) != typeof(byte[]) && typeof(Key) != typeof(string))
Debug.WriteLine("Key is not blittable, but no serializer specified via SerializerSettings. Using (slow) DataContractSerializer as default.");
#endif
SerializerSettings.keySerializer = ObjectSerializer.Get<Key>();
}

if ((!valueBlittable) && (settings.LogDevice as NullDevice == null) && ((SerializerSettings == null) || (SerializerSettings.valueSerializer == null)))
{
Debug.WriteLine("Value is not blittable, but no serializer specified via SerializerSettings. Using (slow) DataContractSerializer as default.");
#if DEBUG
if (typeof(Value) != typeof(byte[]) && typeof(Value) != typeof(string))
Debug.WriteLine("Value is not blittable, but no serializer specified via SerializerSettings. Using (slow) DataContractSerializer as default.");
#endif
SerializerSettings.valueSerializer = ObjectSerializer.Get<Value>();
}

Expand Down
4 changes: 1 addition & 3 deletions cs/src/core/ClientSession/ClientSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1144,9 +1144,7 @@ public void DeleteCompletionCallback(ref Key key, Context ctx)
=> _clientSession.functions.DeleteCompletionCallback(ref key, ctx);

public int GetInitialLength(ref Input input)
{
return _clientSession.variableLengthStruct.GetInitialLength(ref input);
}
=> _clientSession.variableLengthStruct.GetInitialLength(ref input);

public int GetLength(ref Value t, ref Input input)
=> _clientSession.variableLengthStruct.GetLength(ref t, ref input);
Expand Down
2 changes: 1 addition & 1 deletion cs/src/core/Index/FASTER/FASTERImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1575,7 +1575,7 @@ ref hlog.GetValue(newPhysicalAddress),
}
else
{
// CAS failed. Fall through to call InternalRMW again to restart the sequence and return that status.
// CAS failed. Retry in loop.
hlog.GetInfo(newPhysicalAddress).Invalid = true;
}
#endregion
Expand Down
9 changes: 9 additions & 0 deletions cs/src/core/VarLen/SpanByteAndMemory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ public SpanByteAndMemory(SpanByte spanByte)
Memory = default;
}

/// <summary>
/// Constructor using SpanByte at given (fixed) pointer, of given length
/// </summary>
public SpanByteAndMemory(void* pointer, int length)
{
SpanByte = new SpanByte(length, (IntPtr)pointer);
Memory = default;
}

/// <summary>
/// Get length
/// </summary>
Expand Down

0 comments on commit 03af7ca

Please sign in to comment.