When does the memory pointed to by a SpanByte get released? #928
Unanswered
Fleury (xFleury)
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
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
spanBytesession.Read(key, out spanByte);That
spanBytehas 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.Writeand 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?All reactions