Skip to content

Commit

Permalink
Add note about creating arrays using newobj
Browse files Browse the repository at this point in the history
Contributes to dotnet#90038
  • Loading branch information
jkotas committed Aug 5, 2023
1 parent 33c870e commit 08e9f51
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/design/specs/Ecma-335-Augments.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ This is a list of additions and edits to be made in ECMA-335 specifications. It
- [Atomic reads and writes](#atomic-reads-and-writes)
- [Backward branch constraints](#backward-branch-constraints)
- [Transient pointers](#transient-pointers)
- [Creating arrays using newobj](#creating-arrays-using-newobj)
- [API documentation](#api-documentation)
- [Debug Interchange Format](#debug-interchange-format)

Expand Down Expand Up @@ -1056,6 +1057,10 @@ The paragraphs mentioning "transient pointers" in section "I.12.3.2.1 The evalua

Instead, note is added to sections "III.3.39 ldarga" and "III.3.44 ldloca": The arguments / local variables are stored in unmanaged memory. The address of argument / local variable can be converted to unmanaged pointer without explicit pinning.

## Creating arrays using newobj

Note about creating zero-based, one-dimensional arrays in section III.4.21 "newobj – create a new object" is replaced with "All zero-based, one-dimensional arrays *should* be created using newarr, not newobj". Rationale: All arrays have runtime provided constructors. It does not make sense to disallow one specific constructors just because there is more efficient alternative.

## API documentation

API documentation included in partition IV: Profiles and Libraries is superseded by the actively maintained API documentation in https://github.com/dotnet/dotnet-api-docs repo. The documentation is published at https://docs.microsoft.com/en-us/dotnet/api/.
Expand Down

0 comments on commit 08e9f51

Please sign in to comment.