dotnet / dotnet/dotnet-api-docs
Space used in UnmanagedMemoryAccessor.WriteArray is not documented
- Lingua principale
- C#
- Stelle
- 949
- Fork
- 1.7k
- Merge medio
- 2g 19h
- PR unite (30g)
- 52
Descrizione
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.
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia dal codice sorgente referenziato SafeBuffer.cs alla riga 334 e individua la documentazione dell’API per UnmanagedMemoryAccessor.WriteArray. Documenta che ogni elemento dell’array usa la dimensione interna allineata invece di Marshal.SizeOf, in modo che i chiamanti possano determinare lo spazio richiesto nel buffer unmanaged.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- csharp
- Ambito
- documentation
- Tipo di issue
- Documentazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100