Age | Commit message (Collapse) | Author | Files | Lines |
|
'System.Private.CoreLib.Shared' project. (#12967)
|
|
when the assembly is Private.Corelib (#12954)
|
|
Fix corefx break due to missing internal method
|
|
If you pass an null payload using Write<T>, and in the EventListener then call PayloadNames, it
will throw an IndexOutOfRangeException. It should just return null. This fixes this.
|
|
System.Runtime.WindowsRuntime uses CancellationTokenRegistration.TryDeregister instead of Dispose to avoid a potential deadlock due to blocking waiting for an in-progress cancellation to complete. Putting back TryDeregister to unblock corefx until a corresponding public API is exposed for this.
|
|
|
|
Improve performance of CancellationToken.Register / CancellationTokenRegistration.Dispose
|
|
Floating-Point Classification APIs
|
|
System.Private.CoreLib.csproj (#12356)
Fixes issue #12355
Project System.Private.CoreLib.csproj imports directly Microsoft.Net.Compilers.props
at line# 4 before including dir.props from repo root. $(RepoRoot)/dir.props imports
Microsoft.Net.Compilers.props at line# 186. As a result of this sequence of duplicated
project imports and lack of safeguards against importing the same .props file twice
MSBuild reports that Microsoft.Net.Compilers.props file is included twice with warning
that second import will be ignored - in this case not evaluated. This results
in initialization of Microsoft.Net.Compilers.props values to defaults because MSBuild
evaluates Microsoft.Net.Compilers.props only once before $(RepoRoot)/dir.props are included.
Removing import of Microsoft.Net.Compilers.props from System.Private.CoreLib.csproj
and moving $(RepoRoot)/dir.props file import to top of System.Private.CoreLib.csproj
solves these problems by ensuring expected order of evaluation of Microsoft.Net.Compilers.props
file by MSBuild after all project wide values are initialized in $(RepoRoot)/dir.props.
|
|
CancellationTokenRegistration.Dispose
CancellationToken.Register currently allocates an object per call. This PR makes it allocation-free (amortized).
The current implementation was optimized for scalability, using a lock-free algorithm to minimize contention when lots of threads are registering with a token concurrently. Each registration allocates an object which is then stored into a lock-free sparse array data structure. But the level of scalability enabled is unnecessary for the vast majority of CancellationToken usage, adds non-trivial complexity to the implementation, and adds costs to the most common usage scenarios, e.g. a single CancellationToken that registered with and the unregistered with repeatedly.
The new implementation strikes a (IMO) better balance between performance and scalability, retaining most of the latter while doing much better for the former in the most interesting use cases. CancellationTokenSource now maintains an array of partition objects, each of which is lazily-initialized, contains a lock that protects that partition, and contains a linked list of registration objects. The striped locking helps maintain most of the scalability and also enables node reuse due to not suffering from ABA problems.
(All numbers that follow are 64-bit.)
The size of CancellationTokenSource itself doesn't change (64 bytes), so allocating a CancellationTokenSource and then never registering with its token remains the same in both speed and space.
The size overhead associated with the first registration on a CancellationTokenSource improves. With the old implementation, the first registration would result in 272 bytes allocated, whereas with the new implementation that shrinks to 218.
Each additional registration at the same time in the CancellationToken is now larger than in the old implementation, 80 bytes instead of ~56 bytes (it varies in the old implementation due to the details of the lock-free algorithm and when new segments are created), but these new node allocations are reusable. So if you register 100 registrations with the same CancellationToken and don't unregister any of them, you'll incur ~8000 bytes of allocation instead of ~5600, but if you instead register and unregister them 100 times, you'll only incur ~80 bytes of allocation instead of ~5600, with objects reused for the former case but not the latter case.
Speed is also significantly improved. A single thread registering and unregistering repeatedly from a token is now ~2x the old implementation in throughput. Similarly with eight threads on eight logical cores all registering/unregistering concurrently.
Finally, the size of CancellationTokenRegistration also shrinks. This struct is often contained in other classes that have registered with the token, and so will end up shrinking the size of those allocations as well.
|
|
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
|
|
This matches our new behavior with whitespace paths
|
|
* Encoding code clean up
This change to clean all the serialization code from the encoding and move the files to the shared folder
* delete DecoderNLS
* re-add DecoderNls with the right casing
* remove bIsMicrosoftBestFitFallback
* Misc fixes per review comments
|
|
System.Double.
|
|
|
|
* Path whitespace changes.
Change IsNullOrWhitespace to IsNullOrEmpty to be more consistent with legacy desktop .NET code. Path.GetFullPath no longer trims trailing whitespace. (Windows will still eat trailing spaces)
* Fix compilation errors with searchPattern
|
|
* Removed preemptive checks for path being too long.
Instead let the native interop handle it.
* Deleted unused constants.
|
|
Reverting this PR to unblock coreclr ingestion in corefx. I will open another PR to bring this change back once the infrastructure changes are merged into buildtools and consumed by corefx.
See: https://github.com/dotnet/corefx/pull/22295#issuecomment-315574780
cc: @stephentoub
|
|
when the assembly is Private.Corelib (#12830)
|
|
|
|
|
|
|
|
Merge nmirror to master
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
|
|
* Delete LazyInitializer.cs
* Update LazyInitializer.cs
|
|
This is a legacy switch from desktop; we used to throw exceptions in certain cases, now we don't, and for whatever reason it was deemed an app compat issue on desktop, so a switch was added to continue throwing that exception if the switch was set. This was all then inherited into coreclr. But there's no reason anyone would want to opt-in to the behavior on core, and the checks for it are actually measurable in scenarios that stress registering/unregistering cancellation tokens.
I'm simply deleting the switch.
|
|
CoreCLR implementation cached s_activatorFactorySelector delegate, but CoreRT did not cache it - it got commented out during earlier AOT binary size optimization efforts. I have unified it by avoiding s_activatorFactorySelector delegate altogether to keep the best of both.
|
|
|
|
|
|
|
|
Merge nmirror to master
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
|
|
Merge nmirror to master
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
|
|
|
|
|
|
tarekgh/CleanupSerializationInEncoding
Clean up serialization from Encoding
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
|
|
|
|
Merge nmirror to master
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
|
|
Merge nmirror to master
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
|
|
* Rename m_firstChar to _firstChar to reduce CoreRT diffs
* Reducing diffs with CoreRT
* Delete dead code
|
|
Merge nmirror to master
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
|
|
Port https://github.com/dotnet/corert/pull/4030/commits/a3837f7fc60a1b7db872cfef6463f74fb1ffeafb to CoreCLR
|
|
|
|
* Make ResourceManager netstandard 2.0 API behave correctly
In netstandard 2.0 we have enabled the APIs like GetObject, GetStream,..etc. these are not functioning correctly in UWP apps because was assuming we always uses PRI files. The changes here is to initialize the managed resources too and let these APIs behave as if we are running inside desktop app.
* added #ifdef
* Remove the throwing as PRI can handle case insenitive lookup
* remove un-needed resources
|
|
|
|
Merge nmirror to master
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
|
|
|
|
|
|
* Move build-restore.cmd back to build-managed
buildpipeline needs to be updated to make this split
* Cleanup dir.props/dir.targets
* Add back VS clues
* Reformat whitespaces to match VS convention
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
|
|
Breaks:
int idx = "\uabcd".IndexOf("", 1, StringComparison.OrdinalIgnoreCase);
should return 1, returns -1 instead.
(propagated fix from CoreRT)
|
|
Merge nmirror to master
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
|
|
(#12430)
|