summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorAlexander Köplinger <alex.koeplinger@outlook.com>2015-02-12 10:58:30 +0100
committerAlexander Köplinger <alex.koeplinger@outlook.com>2015-02-12 11:35:10 +0100
commitab59f474cd266f7bb1a484ac602ee360b933c529 (patch)
tree6966f3b5fdb719b3525d422bc7aa7fd54fd6973e /Documentation
parented6dde4695f531bedac217af54070942189f7b77 (diff)
downloadcoreclr-ab59f474cd266f7bb1a484ac602ee360b933c529.tar.gz
coreclr-ab59f474cd266f7bb1a484ac602ee360b933c529.tar.bz2
coreclr-ab59f474cd266f7bb1a484ac602ee360b933c529.zip
[docs] Get rid of multiple consecutive blank lines
See markdownlint rule MD-012: https://github.com/mivok/markdownlint/blob/master/docs/RULES.md#md012---multiple-consecutive-blank-lines
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/clr-code-guide.md15
-rw-r--r--Documentation/intro-to-clr.md1
-rw-r--r--Documentation/mscorlib.md1
3 files changed, 0 insertions, 17 deletions
diff --git a/Documentation/clr-code-guide.md b/Documentation/clr-code-guide.md
index a5f0595d43..0cdd004f36 100644
--- a/Documentation/clr-code-guide.md
+++ b/Documentation/clr-code-guide.md
@@ -172,7 +172,6 @@ The following code fragment shows how handles are used. In practice, of course,
ah = CreateHandle(AllocateObject(pMT));
bh = CreateHandle(AllocateObject(pMT));
-
DoSomething (ObjectFromHandle(ah),
ObjectFromhandle(bh));
@@ -230,7 +229,6 @@ While you are running in preemptive mode, OBJECTREF's are strictly hands-off; th
Code you want run in cooperative mode
} // leaving scope automatically restores original mode
-
It's perfectly legal to invoke GCX_COOP() when the thread is already in cooperative mode. GCX_COOP will be a NOP in that case. Likewise for GCX_PREEMP.
GCX_COOP and GCX_PREEMP will never throw an exception and return no error status.
@@ -271,7 +269,6 @@ You can assert the need to be in a particular mode in the contract by using one
}
CONTRACTL_END
-
CONTRACTL
{
MODE_PREEMPTIVE
@@ -288,7 +285,6 @@ There are also standalone versions:
GCX_ASSERT_PREEMP();
}
-
You'll notice that the standalone versions are actually holders rather than simple statements. The intention was that these holders would assert again on scope exit to ensure that any backout holders are correctly restoring the mode. However, that exit check was disabled initially with the idea of enabling it eventually once all the backout code was clean. Unfortunately, the "eventually" has yet to arrive. As long as you use the GCX holders to manage mode changes, this shouldn't really be a problem.
### Use OBJECTREF to refer to object references as it does automatic sanity checking.
@@ -453,7 +449,6 @@ Suppose you want to auto-close the handle if an error occurs but keep the handle
hFile.SuppressRelease();
return hFile;
-
### Common Features of Holders
All holders, no matter how complex or simple, offer these basic services:
@@ -511,7 +506,6 @@ Holders consistently release on destruction – that's their whole purpose. Sadl
### New'ed array:
-
**Wrong:**
Foo *pFoo = new Foo[30];
@@ -706,8 +700,6 @@ Currently, the "S_" types are available only for unsigned ints and SIZE_T. Check
**Key Takeaway: Do not roll your own overflow checks. Always use safemath.h.** Writing correct overflow-safe arithmetic code is harder than you might think (take a look at the implementation in [safemath.h][safemath.h] if you don't believe me.) Every unauthorized version is another security hotspot that has to be watched carefully. If safemath.h doesn't support the functionality you need, please get the functionality added to safemath.h rather than creating a new infrastructure.
-
-
**Key Takeaway: Don't let premature perf concerns stop you from using safemath.h.** Despite the apparently complexity, the optimized codegen for this helper is very efficient and in most cases, at least as efficient as any hand-rolled version you might be tempted to create.
**Note:** If you've worked on other projects that use the SafeInt class, you might be wondering why we don't do that here. The reason is that we needed something that could be used easily from exception-intolerant code.
@@ -778,8 +770,6 @@ To enter or leave a crst, you must wrap the crst inside a CrstHolder. All operat
} // implicit leave
-
-
**You can only enter and leave Crsts in preemptive GC mode.** Attempting to enter a Crst in cooperative mode will forcibly switch your thread into preemptive mode.
If you need a Crst that you can take in cooperative mode, you must pass a special flag to the Crst constructor to do so. See the information about CRITSECT_UNSAFE_\* flags below. You will also find information about why it's preferable not to take Crsts in cooperative mode.
@@ -796,7 +786,6 @@ You can also manually acquire and release crsts by calling the appropriate metho
} // implicit leave
-
Note that holders do not let you nest Acquires or Releases. You will get an assert if you try. Introduce a new scope and a new holder if you need to do this.
If you need to create a CrstHolder without actually entering the critical section, pass FALSE to the holder's "take" parameter like this:
@@ -807,7 +796,6 @@ If you need to create a CrstHolder without actually entering the critical sectio
} // no implicit leave
-
If you want to exit the scope without leaving the Crst, call SuppressRelease() on the holder:
{
@@ -815,8 +803,6 @@ If you want to exit the scope without leaving the Crst, call SuppressRelease() o
ch.SuppressRelease();
} // no implicit leave
-
-
### Other Crst Operations
If you want to validate that you own no other locks at the same or lower level, assert the debug-only IsSafeToTake() method:
@@ -1103,7 +1089,6 @@ Of course, there are exceptions to this. In particular, if there is a clear code
Rule: You should only use GetThreadNULLOk if it is patently obvious from the call site that NULL is dealt with directly. Obviously, this would be bad:
-
GetThreadNULLOk()->BeginCriticalRegion();
This is also frowned upon, as it's unclear whether a NULL Thread is handled:
diff --git a/Documentation/intro-to-clr.md b/Documentation/intro-to-clr.md
index fae5341fac..8df5b1627d 100644
--- a/Documentation/intro-to-clr.md
+++ b/Documentation/intro-to-clr.md
@@ -256,7 +256,6 @@ Phew! The runtime does a lot! It has taken many pages just to describe _some_ o
- [Partition III CIL Instruction Set][cil-spec]
- [.NET Framework Design Guidelines](http://msdn.microsoft.com/en-us/library/ms229042.aspx)
-
[ecma-spec]: http://msdn.microsoft.com/en-us/netframework/aa569283.aspx
[clr]: http://msdn.microsoft.com/en-us/library/8bs2ecf4(VS.71).aspx
[cil-spec]: http://download.microsoft.com/download/7/3/3/733AD403-90B2-4064-A81E-01035A7FE13C/MS%20Partition%20III.pdf
diff --git a/Documentation/mscorlib.md b/Documentation/mscorlib.md
index 670ac615b4..03cfceeee8 100644
--- a/Documentation/mscorlib.md
+++ b/Documentation/mscorlib.md
@@ -337,7 +337,6 @@ Here's a simplified example. Note how this instance uses the binder described in
GCPROTECT_END();
}
-
# Interactions with Other Subsystems
## Debugger