Skip to content

GC Hole for SpanByte and other ones #38

@hamarb123

Description

@hamarb123

return (byte*)Unsafe.AsPointer(ref payload);

this member is called here

Buffer.MemoryCopy(key.ToPointerWithMetadata(), curr, key.Length, key.Length);

which this API is called from the public API TryWriteKeyValueSpanByte here

if (!WriteSerializedSpanByte(ref key, ref value))

which takes ref SpanByte.

It is a GC hole since it's never pinned or otherwise fixed.

This is also a GC hole, since the memory is not fixed (you can also just use Unsafe.SizeOf here):

return (int)((long)Unsafe.AsPointer(ref arr[1]) - (long)Unsafe.AsPointer(ref arr[0]));

This is also seems to be a GC hole, since the memory is never fixed on this public API:

byte* ptr = (byte*)Unsafe.AsPointer(ref spanByte);

(note this list is not exhaustive)

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions