Skip to content

Space used in UnmanagedMemoryAccessor.WriteArray is not documented #5239

Open
@agocke

Description

@agocke

The important bit of this issue is here: https://referencesource.microsoft.com/#mscorlib/system/runtime/interopservices/safebuffer.cs,334

WriteArray is specified to take an array and write it to an unmanaged buffer. However, the space used for each element of the array is not the standard Marshal.SizeOf, it's an internal-only Marshal.SizeOfAligned, which can be significantly different. This means that callers can't know how much space is actually required to write the array without reading the source code themselves.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions