You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Organize some markdowns and fix links (dotnet#1159)
* Move files into hierarchy
* fix more links
* Fix botr and features links
* Remove bad apostrophe
* spelling
* Apply suggestions from code review
Co-Authored-By: Youssef Victor <[email protected]>
* Update docs/coding-guidelines/package-projects.md
Co-Authored-By: Jan Kotas <[email protected]>
Co-authored-by: Youssef Victor <[email protected]>
Co-authored-by: Jan Kotas <[email protected]>
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -157,6 +157,6 @@ See [IdnMapping.cs](./src/libraries/System.Private.CoreLib/src/System/Globalizat
157
157
158
158
### Porting Files from Other Projects
159
159
160
-
There are many good algorithms implemented in other languages that would benefit the .NET Core project. The rules for porting a Java file to C#, for example, are the same as would be used for copying the same file, as described above.
160
+
There are many good algorithms implemented in other languages that would benefit the .NET Core project. The rules for porting a Java file to C#, for example, are the same as would be used for copying the same file, as described above.
161
161
162
162
[Clean-room](https://en.wikipedia.org/wiki/Clean_room_design) implementations of existing algorithms that are not permissively licensed will generally not be accepted. If you want to create or nominate such an implementation, please create an issue to discuss the idea.
Copy file name to clipboardExpand all lines: docs/coding-guidelines/EventLogging.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -6,14 +6,14 @@ Event Logging is a mechanism by which CoreClr can provide a variety of informati
6
6
7
7
# Adding Events to the Runtime
8
8
9
-
- Edit the [Event manifest](../../src/vm/ClrEtwAll.man) to add a new event. For guidelines on adding new events, take a look at the existing events in the manifest and this guide for [ETW Manifests](https://msdn.microsoft.com/en-us/library/dd996930%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396).
9
+
- Edit the [Event manifest](../../src/coreclr/src/vm/ClrEtwAll.man) to add a new event. For guidelines on adding new events, take a look at the existing events in the manifest and this guide for [ETW Manifests](https://msdn.microsoft.com/en-us/library/dd996930%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396).
10
10
- The build system should automatically generate the required artifacts for the added events.
11
-
- Add entries in the [exclusion list](../../src/vm/ClrEtwAllMeta) if necessary
11
+
- Add entries in the [exclusion list](../../src/coreclr/src/vm/ClrEtwAllMeta.lst) if necessary
12
12
- The Event Logging Mechanism provides the following two functions, which can be used within the VM:
13
13
- **FireEtw**EventName, this is used to trigger the event
14
14
- **EventEnabled**EventName, this is used to see if any consumer has subscribed to this event
15
15
16
16
17
17
# Adding New Logging System
18
18
19
-
Though the the Event logging system was designed for ETW, the build system provides a mechanism, basically an [adapter script- genXplatEventing.py](../../src/scripts/genXplatEventing.py) so that other Logging System can be added and used by CoreClr. An Example of such an extension for [LTTng logging system](https://lttng.org/) can be found in [genXplatLttng.py](../../src/scripts/genXplatLttng.py)
19
+
Though the the Event logging system was designed for ETW, the build system provides a mechanism, basically an [adapter script- genEventing.py](../../src/coreclr/src/scripts/genEventing.py) so that other Logging System can be added and used by CoreClr. An Example of such an extension for [LTTng logging system](https://lttng.org/) can be found in [genLttngProvider.py](../../src/coreclr/src/scripts/genLttngProvider.py)
The makeup of a package folder is primarily a grouping of project references to the projects that compose that package. Settings within each referenced project determines where that asset will be placed in the package. For example, reference assembly projects will be placed under the `ref/{targetMoniker}` folder in the package and implementations will be under either `lib/{targetMoniker}` or `runtimes/{rid}/lib/{targetMoniker}`. Whenever NuGet evaluates a package in the context of a referencing project it will choose the best compile time asset (preferring `ref`, then falling back to `lib`) and runtime asset (preferring `runtimes/{rid}/lib` and falling back to `lib`) for every package that is referenced. For more information see http://docs.nuget.org/.
218
219
219
-
Asset projects (`.csproj`, `.vbproj`, or `.depproj`) can control their `{targetMoniker}` using the `PackageTargetFramework` property in the project file. Similarly `{rid}` is controlled using the `PackageTargetRuntime` property. In the corefx repo we automatically select default values for these properties based on the [Build pivots](#build-pivots). These can be overridden in the project reference using metadata of the same name, but this is rarely needed.
220
+
Asset projects (`.csproj`, `.vbproj`, or `.depproj`) can control their `{targetMoniker}` using the `PackageTargetFramework` property in the project file. Similarly `{rid}` is controlled using the `PackageTargetRuntime` property. For the libraries we automatically select default values for these properties based on the build pivots. These can be overridden in the project reference using metadata of the same name, but this is rarely needed.
220
221
221
222
The primary thing that the library author needs to do in order to ensure the correct asset selection is:
Copy file name to clipboardExpand all lines: docs/coding-guidelines/performance-guidelines.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ Different applications have different needs when it comes to performance. For l
5
5
6
6
Much has been written about writing high-performance code in C#. This page provides links to some of that material and will expand over time as additional resources are found and identified as being relevant and useful.
7
7
8
-
You can read [CoreCLR Performance Requirements](../../coreclr/project-docs/performance-guidelines.md) to learn more.
8
+
You can read [CoreCLR Performance Requirements](../project/performance-guidelines.md) to learn more.
Copy file name to clipboardExpand all lines: docs/coding-guidelines/project-guidelines.md
+2-1
Original file line number
Diff line number
Diff line change
@@ -244,7 +244,8 @@ Each source file should use the following guidelines
244
244
-`.WinRT.cs` - implementation based on [WinRT](https://en.wikipedia.org/wiki/Windows_Runtime)
245
245
246
246
## Define naming convention
247
-
As mentioned in [Conventions for forked code](conventions-for-forked-code)`#ifdef`ing the code is the last resort as it makes code harder to maintain overtime. If we do need to use `#ifdef`'s we should use the following conventions:
247
+
248
+
As mentioned in [Conventions for forked code](#conventions-for-forked-code)`#ifdef`ing the code is the last resort as it makes code harder to maintain overtime. If we do need to use `#ifdef`'s we should use the following conventions:
248
249
- Defines based on conventions should be one of `$(OSGroup)`, `$(TargetGroup)`, `$(ConfigurationGroup)`, or `$(Platform)`, matching exactly by case to ensure consistency.
- Defines based on convention should match the pattern `FEATURE_<feature name>`. These can unique to a given library project or potentially shared (via name) across multiple projects.
This document provides the steps you need to take to update the reference assembly when adding new **public** APIs to an implementation assembly (post [API Review](https://github.com/dotnet/corefx/blob/master/Documentation/coding-guidelines/adding-api-guidelines.md)).
1
+
This document provides the steps you need to take to update the reference assembly when adding new **public** APIs to an implementation assembly (post [API Review](adding-api-guidelines.md)).
2
2
3
-
## For most assemblies within corefx
4
-
1) Implement the API in the source assembly and [build it](../project-docs/developer-guide.md#building-individual-libraries).
5
-
2) Run the following command (from the src directory) `msbuild /t:GenerateReferenceSource` to update the reference assembly**.
6
-
3) Navigate to the ref directory and build the reference assembly.
7
-
4) Add, build, and run tests.
3
+
## For most assemblies within libraries
4
+
5
+
1. Implement the API in the source assembly and [build it](../workflow/building/libraries/README.md#building-individual-libraries).
6
+
2. Run the following command (from the src directory) `msbuild /t:GenerateReferenceSource` to update the reference assembly**.
7
+
3. Navigate to the ref directory and build the reference assembly.
8
+
4. Add, build, and run tests.
8
9
9
10
****Note:** If you already added the new API to the reference source, re-generating it (after building the source assembly) will update it to be fully qualified and placed in the correct order. This can be done by running the `GenerateReferenceSource` command from the ref directory.
10
11
11
12
## For System.Runtime
13
+
12
14
These steps can also be applied to some unique assemblies which depend on changes in System.Private.Corelib coming from [coreclr](https://github.com/dotnet/coreclr) (partial facades like [System.Memory](https://github.com/dotnet/corefx/blob/83711167ee74d2e87cf2d5ed3508c94044bb7edc/src/System.Memory/src/System.Memory.csproj#L6), for example).
13
15
1) Build coreclr release.
14
-
2) Build corefx release with coreclr bits (see [Testing with private CoreCLR bits](../project-docs/developer-guide.md#testing-with-private-coreclr-bits) for more details).
16
+
2) Build corefx release with coreclr bits (see (// TODO //)) for more details).
15
17
3) Run `msbuild /t:GenerateReferenceSource /p:ConfigurationGroup=Release` from the System.Runtime/ref directory.
16
-
4) Filter out all unrelated changes and extract the changes you care about (ignore certain attributes being removed). Generally, this step is not required for other reference assemblies.
18
+
4) Filter out all unrelated changes and extract the changes you care about (ignore certain attributes being removed). Generally, this step is not required for other reference assemblies.
Copy file name to clipboardExpand all lines: docs/design/coreclr/botr/method-descriptor.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -50,11 +50,11 @@ P/Invoke methods. These are methods marked with DllImport attribute.
50
50
51
51
**EEImpl**
52
52
53
-
Delegate methods whose implementation is provided by the runtime (Invoke, BeginInvoke, EndInvoke). See [ECMA 335 Partition II - Delegates](../project-docs/dotnet-standards.md).
53
+
Delegate methods whose implementation is provided by the runtime (Invoke, BeginInvoke, EndInvoke). See [ECMA 335 Partition II - Delegates](../../../project/dotnet-standards.md).
54
54
55
55
**Array**
56
56
57
-
Array methods whose implementation is provided by the runtime (Get, Set, Address). See [ECMA Partition II – Arrays](../project-docs/dotnet-standards.md).
57
+
Array methods whose implementation is provided by the runtime (Get, Set, Address). See [ECMA Partition II – Arrays](../../../project/dotnet-standards.md).
Copy file name to clipboardExpand all lines: docs/design/coreclr/botr/mscorlib.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -172,7 +172,7 @@ FCalls require a lot of glue, too much to describe here. Look at [fcall.h][fcall
172
172
173
173
### GC Holes, FCall, and QCall
174
174
175
-
A much more complete discussion on GC holes can be found in the [CLR Code Guide](../coding-guidelines/clr-code-guide.md). Look for ["Is your code GC-safe?"](../coding-guidelines/clr-code-guide.md#is-your-code-gc-safe). This tailored discussion motivates some of the reasons why FCall and QCall have some of their strange conventions.
175
+
A much more complete discussion on GC holes can be found in the [CLR Code Guide](../../../coding-guidelines/clr-code-guide.md). Look for ["Is your code GC-safe?"](../../../coding-guidelines/clr-code-guide.md#2.1). This tailored discussion motivates some of the reasons why FCall and QCall have some of their strange conventions.
176
176
177
177
Object references passed as parameters to FCall methods are not GC-protected, meaning that if a GC occurs, those references will point to the old location in memory of an object, not the new location. For this reason, FCalls usually follow the discipline of accepting something like "StringObject*" as their parameter type, then explicitly converting that to a STRINGREF before doing operations that may trigger a GC. You must GC protect object references before triggering a GC, if you expect to be able to use that object reference later.
Copy file name to clipboardExpand all lines: docs/design/coreclr/botr/threading.md
+5-5
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ Every managed thread has an associated Thread object, defined in [threads.h][thr
27
27
28
28
All Thread objects are stored in the ThreadStore (also defined in [threads.h][threads.h]), which is a simple list of all known Thread objects. To enumerate all managed threads, one must first acquire the ThreadStoreLock, then use ThreadStore::GetAllThreadList to enumerate all Thread objects. This list may include managed threads which are not currently assigned to native threads (for example, they may not yet be started, or the native thread may already have exited).
Each managed thread that is currently assigned to a native thread is reachable via a native thread-local storage (TLS) slot on that native thread. This allows code that is executing on that native thread to get the corresponding Thread object, via GetThread().
33
33
@@ -135,8 +135,8 @@ Sync blocks are stored in the Sync Block Table, and are addressed by sync block
135
135
136
136
The details of object headers and sync blocks are defined in [syncblk.h][syncblk.h]/[.cpp][syncblk.cpp].
If there is room on the object header, Monitor stores the managed thread ID of the thread that currently holds the lock on the object (or zero (0) if no thread holds the lock). Acquiring the lock in this case is a simple matter of spin-waiting until the object header's thread ID is zero, and then atomically setting it to the current thread's managed thread ID.
142
142
@@ -168,12 +168,12 @@ Thus entering cooperative mode in native code is discouraged. In cases where coo
168
168
169
169
Similarly, GCX\_PREEMP potentially _releases_ a lock that had been held by the thread. Great care must be taken to ensure that all GC references are properly protected before entering preemptive mode.
170
170
171
-
The [Rules of the Code](../coding-guidelines/clr-code-guide.md) document describes the disciplines needed to ensure safety around GC mode switches.
171
+
The [Rules of the Code](../../../coding-guidelines/clr-code-guide.md) document describes the disciplines needed to ensure safety around GC mode switches.
172
172
173
173
Crst
174
174
----
175
175
176
-
Just as Monitor is the preferred locking mechanism for managed code, Crst is the preferred mechanism for VM code. Like Monitor, Crst is a hybrid lock that is aware of hosts and GC modes. Crst also implements deadlock avoidance via "lock leveling," described in the [Crst Leveling chapter of the BotR](../coding-guidelines/clr-code-guide.md#264-entering-and-leaving-crsts).
176
+
Just as Monitor is the preferred locking mechanism for managed code, Crst is the preferred mechanism for VM code. Like Monitor, Crst is a hybrid lock that is aware of hosts and GC modes. Crst also implements deadlock avoidance via "lock leveling," described in the [Crst Leveling chapter of the BotR](../../../coding-guidelines/clr-code-guide.md#2.6.4).
177
177
178
178
It is generally illegal to acquire a Crst while in cooperative mode, though exceptions are made where absolutely necessary.
2. The work to allow adding new types and methods after module load means ICorProfilerInfo7::ApplyMetadata will now potentially trigger a GC, and will not be callable in situations where a GC can not happen (for example ICorProfilerCallback::RootReferences).
7
7
3. As part of the work to allow ReJIT on attach ReJITted methods will no longer be inlined (ever). Since the inlining is blocked there won't be a `ICorProfilerCallback::JITInlining` callback.
0 commit comments