Closed Folleach closed 1 year ago
This appens because implementation of new ReadOnlySpan<char>(pointer, length)
in net framework does not keep itself pinnable inside, this allows the GC to move the string that is being worked on...
So, I'll just change the constructor to the Slice
method in LLParserSpan
, because Slice
saves pinnable object
Describe the bug
see ddc84d58accbf3039146bf79d36fc5fbf3674a80 to learn about the temporary fix
During parsing, a lot of
ReadOnlySpan<char>
is created reffered to the main stringAt one moment the data in span turns into a pile of garbage
Test
Decode_SampleStruct_ShouldBeCorrect
can catch this behavior