You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I couldn't find an answer to this in any of the documentation. If I have a KV store defined as FasterKV<ulong, SpanByte> storage;
and I make a session session = storage.For(new SimpleFunctions<ulong, SpanByte>()).NewSession<SimpleFunctions<ulong, SpanByte>>();
and in that session I read to a spanByte session.Read(key, out spanByte);
That spanByte has a pointer to some block of memory somewhere. Am I right to assume that that pointer is valid for the entire duration of the session, but only the duration of the session?
Similarly, if I call session.Write and pass it a SpanByte, do I need to ensure that the pointer I give it is also valid for the entire duration of the session? Or do I only need to keep it valid for the duration of the call to the Write?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I couldn't find an answer to this in any of the documentation. If I have a KV store defined as
FasterKV<ulong, SpanByte> storage;
and I make a session
session = storage.For(new SimpleFunctions<ulong, SpanByte>()).NewSession<SimpleFunctions<ulong, SpanByte>>();
and in that session I read to a
spanByte
session.Read(key, out spanByte);
That
spanByte
has a pointer to some block of memory somewhere. Am I right to assume that that pointer is valid for the entire duration of the session, but only the duration of the session?Similarly, if I call
session.Write
and pass it aSpanByte
, do I need to ensure that the pointer I give it is also valid for the entire duration of the session? Or do I only need to keep it valid for the duration of the call to theWrite
?Beta Was this translation helpful? Give feedback.
All reactions