Граф коммитов

29084 Коммитов

Автор SHA1 Сообщение Дата
Stephen Toub 36ab1b5c1e
Remove more number ToStrings from System.Net.Http headers (#30529)
Previously these wouldn't have helped but also wouldn't really have hurt. However, now that StringBuilder doesn't call ToString() by default on numeric types, these are resulting in unnecessary string allocations.
2018-06-19 17:34:55 -04:00
Viktor Hofer 33f401f5a8 Remove StringBuilderCache usage from System.Text.RegularExpressions (#30474)
* Remove StringBuilderCache usage

* fixed buffer size, manual reverse copying & local textinfo

* Fast path for not to encode string

* avoid one span slice

* code formatting & bounds check opt

* Avoid string allocation in char class
2018-06-19 17:34:37 -04:00
Stephen Toub e910a045e6
Remove some allocations from SocketAddress.ToString (#30521)
* Remove some allocations from SocketAddress.ToString

Avoids a string allocation per byte, plus a few other intermediary strings.

* Disable failing SocketAddress.ToString test on Unix
2018-06-19 16:57:48 -04:00
Stephen Toub e1756ebbac
Remove string allocation from Uri.PathDifference (#30514) 2018-06-19 16:55:54 -04:00
Stephen Toub 9b3717bbc8
Remove a few boxing allocations from SecurityIdentifier.ToString (#30512) 2018-06-19 16:55:36 -04:00
Stephen Toub 4a3c31a8da
Remove unnecessary DllImports from System.Drawing.Common (#30510) 2018-06-19 16:54:54 -04:00
Stephen Toub c09a2a5296
Remove StringBuilder in System.IO.Pipes marshaling (#30509)
* Remove StringBuilder in System.IO.Pipes marshaling

To get the impersonated user name, we can just stackalloc space for the Win32 call and then create a string from that, instead of allocating a StringBuilder and its underlying char[], paying the associated StringBuilder marshaling costs, and then creating the string from that.

* Fix existing typo in comment
2018-06-19 16:53:41 -04:00
Stephen Toub 8c0487bfef
Remove some StringBuilder-related allocations from System.Net.Http (#30508)
* Remove boxing and ToString allocations from RangeHeaderValue.ToString

The current code uses ToString(object), boxng the long? and then calling ToString on it.  By instead first checking whether the value is null and only calling ToString(long), we avoid both the box and the string allocations, for both From and To, relying on StringBuilder's ability to format a long directly into its buffer.

* Avoid StringBuilder/char[]/string allocation/copy in DumpHeaders

We can just write into the existing StringBuilder rather than creating a new one, appending to that, copying it to a string, and then appending that string to the original.
2018-06-19 16:51:58 -04:00
Tony Di Nucci 3ed92c4e3b Adding support for synchronous Ping (#30000)
* Adding support for synchronous Ping

* Address PR feedback

* Address additional feedback

* Missed 2nd commented out visibility modifier

* Fix build for UWP

* Remove use of deprecated property

* Refactor to remove need for unsafe block

* Remove redundant calls to Stopwatch.Stop()

* Revert to using IPAddress.Address rather than IPAddress.GetAddressBytes() for IPv4
2018-06-19 13:49:07 -07:00
Jeremy Barton 237ab14caf
Make the Linux TLS hostname comparison be case-insensitive
This change also adds direct tests to CheckX509Hostname, because we still haven't added a strong X509Extension subclass for Subject Alternative Name, which is where more direct exposure would live.
2018-06-19 13:09:42 -07:00
dotnet-maestro-bot 8999b95fdd Update BuildTools, CoreClr, CoreSetup to preview1-02919-01, preview1-26619-04, preview1-26619-03, respectively (#30524) 2018-06-19 14:53:30 -05:00
Eric Erhardt e2aec459cd
Ensure Reflection.Context tests find the correct results. (#30519)
Assert.All on an empty collection will pass.

Also, update the .resx message to mention which test requires the resource.
2018-06-19 13:29:18 -05:00
Kristian Hellang 9ed08bb062 Expose and add unit tests for ISOWeek (#30386)
* Expose ISOWeek in System.Globalization

* Add unit tests for ISOWeek

* PR Feedback

* Add ISOWeek to ApiCompatBaseline

* Added more edge-case tests
2018-06-19 09:17:03 -07:00
Stephen Toub 7d772b56e0 Remove unused method from System.Text.Encoding.CodePages 2018-06-19 09:15:54 -07:00
Jan Kotas fe7adb2bf9
Merge pull request #30497 from dotnet-maestro-bot/master-UpdateDependencies
Update BuildTools, CoreClr, CoreSetup, ProjectNTfs, ProjectNTfsTestILC to preview1-02918-02, preview1-26619-01, preview1-26618-02, beta-26619-00, beta-26619-00, respectively (master)
2018-06-19 06:01:24 -07:00
Fei Peng 9027f4da59 Improve Intel hardware intrinsic APIs 2018-06-19 04:35:50 -07:00
dotnet-maestro-bot 9cc7583cae Update BuildTools, CoreClr, CoreSetup, ProjectNTfs, ProjectNTfsTestILC to preview1-02918-02, preview1-26619-01, preview1-26618-02, beta-26619-00, beta-26619-00, respectively 2018-06-18 22:15:53 -07:00
David Shulman ec1671fd7f
Fix SocketsHttpHandler for Windows auth proxy CONNECT tunneling (#30478)
SocketsHttpHandler wasn't even trying to send Negotiate/NTLM auth tokens to a proxy. This was due
to some invalid logic regarding the "usingProxy" field in HttpConnection. Reworked this logic to
be clearer about the various kinds of proxy scenarios.

I refactored the loopback proxy server and made it much more robust. It can now handle multiple
requests and multiple connections which helps test against the other handlers whose behavior is
different in this area. I plan to do further work in consolidating the LoopbackServer and
LoopbackProxyServer classes in future PRs.

I created a separate HttpClientHandlerTest.Proxy.cs file and moved many existing proxy tests and
added new tests. The current HttpClientHandlerTest.cs file is still over 3000 lines and needs more
refactoring to make it easier to maintain and track test scenario coverage.

Fixes #30330
2018-06-18 16:21:44 -07:00
Vance Morrison 7e4093b978 Expose and Add tests for StringBuilder overloads of TextWriter (#30491)
* Expose and Add tests for StringBuilder overloads of TextWriter

Add tests for implementation in https://github.com/dotnet/coreclr/pull/18281
This supports the issue https://github.com/dotnet/corefx/issues/30048

* Remove empty line

* Added tests for empy and large strings for the Text.Write*(StringBuilder) APIs

* Add AppCompat overrides for UWP.

(lost in merge conflict)

* review feedback
2018-06-18 19:00:42 -04:00
Jan Kotas 3594eb3bb2 Delete PinnableBufferCache (dotnet/corert#5950)
Port https://github.com/dotnet/coreclr/pull/18360 to CoreRT

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Signed-off-by: dotnet-bot-corefx-mirror <dotnet-bot@microsoft.com>
2018-06-18 15:52:36 -07:00
Fei Peng 5c34bea4e2 Improve Intel hardware intrinsic APIs (dotnet/coreclr#17637)
* Improve Intel hardware intrinsic APIs

* Simplify Avx.Extract non-const fallback

Signed-off-by: dotnet-bot-corefx-mirror <dotnet-bot@microsoft.com>
2018-06-18 14:56:20 -07:00
Stephen Toub 16f1fe20e3
Remove multiplication in pal_networking.c (#30496)
* Remove multiplication in pal_networking.c

* Fix paren
2018-06-18 16:51:01 -04:00
Santiago Fernandez Madero d73434c0a8
Cross compile compat pack shims against 2.0 and use the 2.1 inbox ones (#30031)
* Cross compile compat pack shims against 2.0 and use the 2.1 inbox ones

* Fix build issues and use shims.proj produced facades as ref assemblies in the package

* Exclude System.ValueTuple only on nca2.0 and break compat pack dependency on shims package

* PR Feedback

* PR Feedback
2018-06-18 11:24:07 -07:00
John Doe 2d2d5413fb Typo (dotnet/coreclr#18520)
* Acutal -> Actual

* addtional -> additional

* agressive -> aggressive

* agument -> argument

* Alignement -> Alignment

* alredy -> already

* MAnaged -> Managed

* analagous -> analogous

* aquire -> acquire

* arbitary -> arbitrary

Signed-off-by: dotnet-bot-corefx-mirror <dotnet-bot@microsoft.com>
2018-06-18 10:54:08 -07:00
Jared Parsons 3ac2b6527a Document span lifetime issue in CreateSpan (#30490)
The language rules around span safety that C# and F# adhere to assume
there is no way to create a `Span<T>` wrapper over a `ref` local /
parameter. This means `ref` inputs into a method are not considered when
calculating the allowed lifetime of a returned `Span<T>`. Hence both
CreateSpan and CreateReadOnlySpan will be assumed to have heap lifetime
even when provided stack based inputs. Example:

``` c#
Span<int> Example() {
  int i = 42;
  Span<int> span = MemoryMarshal.CreateSpan(ref i, length: 1);
  return span; // C# and F# will allow this
}
```

In this case the actual lifetime of `span` is that of `i`. Yet the
compiler doesn't consider the `ref i` input and hence believes this must
be heap based and hence safe to return out of the method.

This is okay as these methods are unsafe. But want to explicitly
document that fact.

More information on the safety rules can be found in the [span safety
proposal](https://github.com/dotnet/csharplang/blob/master/proposals/csharp-7.2/span-safety.md)
2018-06-18 10:34:58 -07:00
Krzysztof Wicher 21e73c6b70 Add test for #29914 (#30408) 2018-06-18 12:17:45 -04:00
dotnet-maestro-bot 803e0b33cc Update ProjectNTfs, ProjectNTfsTestILC to beta-26618-00, beta-26618-00, respectively (#30481) 2018-06-18 12:17:00 -04:00
Ian Hays 55f2293ddd Add support for concatenated GZip streams. (#30442)
Currently, if you pass two or more concatenated GZipStreams we will read into the second one (to fill a buffer) but not do anything with that information. This PR modifies the Inflater code to instead look at the appended data for the Gzip header magic bytes and treats the rest of the data stream as an additional data segment if they are found.

More info:
- There is no limit to the number of concatenated GZipStreams supported.
- If a GZipStream is appended with garbage that happens to have its first two bytes equal to the GZip header bytes, then an exception will result. This is an acceptable risk, as garbage appended to a valid GZipStream isn't really usable right now anyways since we read past the end of the first stream into that data to fill our input buffer.
- Added exhaustive tests to test buffer boundary behavior
- Concatenated streams are supported using Read, ReadAsync, CopyTo, etc.
2018-06-18 11:59:41 -04:00
Marc Gravell 146fe58389 Sockets on Windows: reduce array allocations during Select, Poll, Receive, Send (#30485)
* untested; zero allocs during Socket.Poll and Socket.Select on Windows (aveat: Socket.Select with > cutoff will still allocate)

* use MemoryMarshal.GetReference - cleanly passes null ref for empty span

* remove all the "unsafe"; pretty sure that the "ref" will count as a "fixed" during the P/Invoke

* avoid allocating in Socket.Send/Socket.Receive when passing multiple segments (synchronous API)

* Revert "avoid allocating in Socket.Send/Socket.Receive when passing multiple segments (synchronous API)"

This reverts commit 343b88602bd7974f64ae8247f5415b6bf590a89b.

* use spans for multi-segment sync send/receive

* remove "unsafe" from select - no longer required

* fix nit whitespace

* address @stephentoub feedback from review:

- prefer Foo* to ref Foo in p/invoke
- avoid repeated .Count access
- use const size stackalloc instead of dynamic
- use ArrayPool instead of allocate
- avoid multiple testing of count when determining stack vs heap
- use smaller stack threshold

* add debug assertions to express intent of file descriptor size vs socket list size

* use slice+span.clear to simplify objectsToPin wipe
2018-06-18 11:56:46 -04:00
kasper3 30148bf4a5 Convert System.Security.Cryptography.Native to C (#30376)
* Rename extension .cpp to .c

* Convert System.Security.Cryptography.Native to C

* Address feedback comments
2018-06-18 11:56:18 -04:00
Marco Rossignoli 2776b63735 Add Path.Join string overloads (#30447)
* update tests

* add null tests

* add null tests

* added uapaot ApiCompatBaseline
2018-06-18 11:53:25 -04:00
jswolf19 a9e5ed00db Exposing CallerArgumentExpressionAttribute from System.Runtime assembly (#30469)
* Expose CallerArgumentExpressionAttribute (#21809)

* added basic CallerArgumentExpressionAttribute tests

* added test to show that overload without optional parameter is taken over method with

* added tests to illustrate behavior of CallerArgumentExpressionAttribute (final behavior may differ)

* added type CallerArgumentExpressionAttribute to uapaot ApiCompatBaseline

* Moved CallerArgumentExpressionTests to non-netfx section

* added newlines as per review
2018-06-18 11:53:06 -04:00
kasper3 9908dee27b Convert S.S.Cryptography.Native.Apple to C (#30448)
* Rename extension .cpp to .c

* Convert S.S.Cryptography.Native.Apple to C

* Use memset instead of consts for zero-init
2018-06-18 11:52:28 -04:00
Stephen Toub f6c6a894bd
Upper-case a const in IPAddress 2018-06-18 11:04:54 -04:00
Hugh Bellamy ac70bb1294 Add some more CodeDom tests (#30387)
* Cleanup some CodeDom product code

* Cleanup CodeDom tests

* Add misc CodeDom tests

* Address PR feedback

* Fix netfx tests
2018-06-18 10:14:28 -04:00
Jan Kotas 7303e22416 Reenable tests for fixed ProjectN bug (#30467)
The bug has been fixed in ProjectN 3 years ago.

Fixes #16747
Fixes #21198
2018-06-17 08:55:28 -04:00
Michal Strehovský 3443fc58c7 Delete ApiCompatBaseline (#30472)
These should not need baselining after #30438.
2018-06-17 08:54:51 -04:00
Jan Kotas b502fae45c Fix accidental differences in CoreLib shared folder 2018-06-16 21:07:18 -07:00
Michal Strehovský d525c2df0f Update unshared Reflection.Emit files
Signed-off-by: dotnet-bot-corefx-mirror <dotnet-bot@microsoft.com>
2018-06-16 20:59:08 -07:00
Marco Rossignoli 2c55db90d6 add overloads (dotnet/coreclr#18458)
Signed-off-by: dotnet-bot-corefx-mirror <dotnet-bot@microsoft.com>
2018-06-16 20:35:32 -07:00
Jan Kotas 9f18d08ea4
Make StackFrame tests robust against varying levels of optimizations (#30463)
- Add NoInlining attributes
- Relax ILOffset validation

Fixes #30444
2018-06-16 19:52:47 -07:00
dotnet-maestro-bot 77082c3a60 Update CoreFx to preview1-26617-01 (#30460) 2018-06-16 22:41:30 -04:00
Jan Kotas c7ff387023 Make Encoding.Unicode.GetString faster on 64-bit platforms (#18263)
UnicodeEncoding was taking fast path only when both source and destination were 8-byte aligned. It was not
the case for Unicode.GetString.

The fix is to just check the source alignment as fast path precondition, and use unaligned write for destination.

Also removed alternative fast path that is not needed anymore, tweaked local variable assignments for better
register allocation, and fixed performance issue introduced by recent big endian portability fix.

Signed-off-by: dotnet-bot-corefx-mirror <dotnet-bot@microsoft.com>
2018-06-16 19:26:18 -07:00
Maryam Ariyan 4ddec547fe moving ARM HW Intrinsics files to shared partition (dotnet/coreclr#18451)
Signed-off-by: dotnet-bot-corefx-mirror <dotnet-bot@microsoft.com>
2018-06-16 18:58:23 -07:00
jswolf19 55d2c58a05 Added CallerArgumentExpressionAttribute (corefx issue 21809) (#18404)
* Added CallerArgumentExpressionAttribute

* Modified CallerAtgumentExpressionAttribute

Removed ArgumentNull check from constructor and reordered members to
be more consistent with other attribute classes.

Signed-off-by: dotnet-bot-corefx-mirror <dotnet-bot@microsoft.com>
2018-06-16 18:58:23 -07:00
Andrey Akinshin 0b0a9d2961 mach_absolute_time as the primary clock source on macOS (#30391) (#30457)
macOS 10.12+ supports clock_gettime (HAVE_CLOCK_MONOTONIC is defined)
However, mach_absolute_time has better resolution and should be used
as the primary clock source.
2018-06-16 20:29:53 -04:00
dotnet-maestro-bot 30fb788751 Update CoreClr, CoreFx to preview1-26616-03, preview1-26616-02, respectively (#30450) 2018-06-16 14:39:53 -04:00
Hugh Bellamy 38836b30cd Remove some dead code from System.ComponentModel.Annotations (#30452)
* Remove dead code from System.ComponentModel.Annotations

* Move tests to correct directory

* Cleanup string.Format usage in exceptions

* Add parameter names to some exceptions

* Address PR feedback
2018-06-16 14:38:42 -04:00
Viktor Hofer 3885ee5a9d Exclude tests that require gdiplus to not produce errors (#30451)
* Exclude tests that require gdiplus to not produce errors

* Move BenchmarkFilter to Common
2018-06-16 10:50:38 -07:00
José Rivero 4f4421879f Moving `Perf_Array` under `System.Tests` namespace (#30434)
This will group its results with the rest of the other benchmarks in the same project.
2018-06-16 10:39:42 -04:00