Skip to content

Commit 4aa77df

Browse files
authored
Add note about creating arrays using newobj (#90070)
Contributes to #90038
1 parent 7f67a4a commit 4aa77df

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

docs/design/specs/Ecma-335-Augments.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ This is a list of additions and edits to be made in ECMA-335 specifications. It
2020
- [Atomic reads and writes](#atomic-reads-and-writes)
2121
- [Backward branch constraints](#backward-branch-constraints)
2222
- [Transient pointers](#transient-pointers)
23+
- [Creating arrays using newobj](#creating-arrays-using-newobj)
2324
- [API documentation](#api-documentation)
2425
- [Debug Interchange Format](#debug-interchange-format)
2526

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

10571058
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.
10581059

1060+
## Creating arrays using newobj
1061+
1062+
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 constructor just because there is more efficient alternative.
1063+
10591064
## API documentation
10601065

10611066
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/.

0 commit comments

Comments
 (0)