summaryrefslogtreecommitdiff
path: root/src/mscorlib
AgeCommit message (Collapse)AuthorFilesLines
2018-05-08Rename mscorlib to System.Private.Corelib (#17926)Maryam Ariyan1185-319909/+0
* diff from just renaming folder mscorlib to System.Private.CoreLib * Updating build.proj to reflect name change Fixes: #17905
2018-05-08Partial implementation of Thread.GetApartmentState (dotnet/corert#5781)Jan Kotas1-0/+2
Related to #5776 Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
2018-05-08Reflection: Fix DefaultValue exception with enums (#17917)stakx1-0/+3
This is related to dbcfd2f9d1, but about enums instead of `DateTime`. Given e.g. a generic method with a parameter `T arg = default(T)` where `T` is the generic type parameter, if that is instantiated with some enum as the generic type argument, then querying the default value of `arg` using `ParameterInfo.[Raw]DefaultValue` will throw a `FormatException`. (The use of generics means that the C# compiler always records a `null` constant in metadata, which isn't usually the case for enums.)
2018-05-08Fix failing System.Reflection.Emit tests (#17915)stakx1-0/+7
Commit fceac03e82 removed a test from `TypeBuilder.SetConstantValue` that is too strict when called from `ParameterBuilder`, but that both `FieldBuilder` and `EnumBuilder` require. Add the same test back, but in `FieldBuilder.SetConstant`.
2018-05-08Move ConcurrentExclusiveSchedulerPair to shared CoreLib partition (#17914)Jan Kotas3-8/+10
2018-05-07 Remove ConcurrentDictionary from System.Private.CoreLib (#17908)Stephen Toub1-60/+20
* Delete stale PRENET45 conditional code * Remove ConcurrentDictionary dependency from ConcurrentExclusiveSchedulerPair
2018-05-07Speed up Array.Reverse by using ref reassignment (#17891)Levi Broderick2-20/+29
* Speed up Array.Reverse by using ref reassignment * Optimize MemoryExtensions.Reverse
2018-05-07Reflection: Fix DefaultValue for optional DateTime (#17877)stakx1-0/+3
Querying the default value of an optional `DateTime` parameter using `ParameterInfo.DefaultValue` can throw a `FormatException` if that default value is a null constant in metadata, which is how the C# compiler encodes a default value of `default(DateTime)`. This commit fixes that error by adding the proper handling for null metadata constants with `DateTime` parameters.
2018-05-07Reflection.Emit: Allow `ParameterBuilder.SetConstant(null)` for value-typed ↵stakx1-6/+3
parameters (#17887) * Add test for dotnet/corefx#26184 The Roslyn C# compiler encodes an optional, value-typed parameter's default value of `default(TValueType)` as a null reference constant in metadata. Add a test that verifies that reflection can do the same using `ParameterBuilder.SetConstant(null)`. * Always allow ParameterBuilder.SetConstant(null) * Remove test project as requested in review These tests move to CoreFX. See dotnet/corefx#29532.
2018-05-05Delete unnecessary internal layer of Span globalization helpers (#17890)Jan Kotas6-246/+88
This change makes the code both smaller and faster. For example, the following is about 1.4x faster with this change: ``` ReadOnlySpan<char> s1 = "Hello world"; ReadOnlySpan<char> s2 = "world"; for (int i = 0; i < 100000000; i++) s1.EndsWith(s2, StringComparison.OrdinalIgnoreCase); ``` Also, I have ported GetCaseCompareOfComparisonCulture code size optimization from #16434 while I was on it because of it fit well with the rest of the changes.
2018-05-05Remove use of ByReference<T> in Memmove ABI (#17889)Levi Broderick1-61/+61
Use new ref reassignment feature instead
2018-05-03Port Marshal UTF8 fixes from CoreRT (#17868)Jan Kotas1-10/+8
2018-05-02typo (#17867)Bernie FitzGerald1-2/+2
Serialable should have been Serializable publically should have been publicly
2018-05-02Clarifying comment on overflow (#17865)Dan Moseley1-0/+3
* Clarifying comment on overflow * Nits
2018-05-02Fix faulty assert in Utilities.SelectBucketIndex (#17863)Stephen Toub1-1/+1
0 is a valid length.
2018-05-02Delete incorrect comment (#17859)Jan Kotas1-1/+0
2018-05-01Rename internal Utf8String to MdUtf8String (#17856)Atsushi Kanamori5-27/+27
We want to start prototyping Utf8String in CoreFxLab and for that, we'll need a bare-bones System.Utf8String class exposed from System.Private.CoreLib. Unfortunately, CoreLib already has an internal struct named System.Utf8String. Since it's only an internal type, we'll exercise eminent domain on its name now and get these noise changes out of the way.
2018-05-01remove duplicatesMarco Rossignoli3-4/+9
2018-04-28Delete unnecessary caches (dotnet/corefx#29392)Jan Kotas1-4/+1
Signed-off-by: dotnet-bot-corefx-mirror <dotnet-bot@microsoft.com>
2018-04-27Fix Number.ParseNumber to not assume '\0' at the end of a span (#17808)Stephen Toub1-26/+35
* Fix Number.ParseNumber to not assume '\0' at the end of a span This routine was written for parsing strings, which are implicitly null-terminated, and it doesn't factor in string length but instead uses tricks to exit loops when the next character is null. Now that the routine is also used for spans, this is very problematic, as spans need not be null terminated, and generally aren't when they represent slices, and expecting a null termination like this can result in walking off the end of valid memory. I would like to see all of this code rewritten to use span. In the interim, though, as a short-term fix I've changed all dereferences of the current position to compare against the length of the span (or, rather, a pointer to the end), and pretend that a null terminator was found if we've hit the end. * Address PR feedback
2018-04-27Add better portable PDB caching to System.Diagnostics.StackTrace. (#17804)Mike McLaughlin2-81/+71
Add portable PDB caching to StackTrace. This is the mscorlib side of the change.
2018-04-25Don't optimize away Task code needed for debugger (#17776)Chuck Ries1-0/+10
This prevents the IL linker from optimizing away some properties/methods related to tasks that are used by a debugger but are not referenced anywhere else in coreclr. This specifically fixes async callstack frames for the xplat C# debugger.
2018-04-25Fix AsyncLocal<class> changed event to not be raised multiple times for one ↵Koundinya Veluri2-50/+71
change in value (#17767) Fix AsyncLocal<class> changed event to not be raised multiple times for one change in value Functional fix for https://github.com/dotnet/coreclr/issues/17758
2018-04-24Move Hashtable & friends to shared parition (#17316)Viktor Hofer11-389/+687
* Move Hashtable & friends to shared parition * Move HashHelper serialization logic into its own file * Remove unchecked keyword in Hashtable
2018-04-23Enable Invoke and GetValue for ref-returning members (#17732)Atsushi Kanamori2-5/+20
* Reapply https://github.com/dotnet/coreclr/pull/17639 * tryagain-wip 4/23/2018 7:27:37 AM - Fix Invoke of enum-returning methods * Assert for refbufargs implying valuetype * Catch ref to void in managed layer
2018-04-20Fix getting the Absolute path while looking up the TZ files (#17711)Tarek Mahmoud Sayed1-2/+2
2018-04-20Preserve pinned flag in {ReadOnly}Memory<T>.Slice (dotnet/corefx#29246) (#17712)dotnet bot2-7/+19
* Preserve pinned flag in {ReadOnly}Memory<T>.Slice * Address PR feedback. Signed-off-by: dotnet-bot-corefx-mirror <dotnet-bot@microsoft.com>
2018-04-20Update xml comment for {ReadOnly}Memory.Pin method (dotnet/corefx#29137) ↵dotnet bot2-8/+34
(#17709) Signed-off-by: dotnet-bot-corefx-mirror <dotnet-bot@microsoft.com>
2018-04-19Rollback https://github.com/dotnet/coreclr/pull/17639 (#17671)Atsushi Kanamori2-6/+6
2018-04-19add field Name to exception (#17668)Marco Rossignoli2-5/+5
2018-04-18Tweak order of interface declarations on string (#17660)Jan Kotas1-1/+1
Fixes https://github.com/dotnet/corefx/issues/29158
2018-04-18Fix reading Time zone rules using Julian days (#17635)Tarek Mahmoud Sayed2-35/+111
* Fix reading Time zone rules using Julian days * Order the condition correctly * Start searching from month 1 and not 0 * Exclude n Julian format * fix typo * Adding the suggested assert
2018-04-18Delete RuntimeMethodHandle.GetSecurityFlag (#17643)Jan Kotas4-16/+7
CAS leftover
2018-04-18Enable Invoke and GetValue for ref-returning members (#17639)Atsushi Kanamori2-6/+6
* Enable Invoke and GetValue for ref-returning members https://github.com/dotnet/corefx/issues/15960 Returned magic object is the object pointed to by the ref. If the ref is null, NullReferenceException. * Fix error message * Found way to reuse InvokeUtil::CreateObject * Remove comment, BYREF case.
2018-04-17Convert native StringBuilder methods to managed (#17472)mikedn1-4/+72
2018-04-17Adding failing string to Boolean and TimeSpan parse failure exceptions (#15661)Szabolcs Dézsi3-92/+130
* Adding failing string to Boolean and TimeSpan parse failure exceptions * Avoid boxing char when using TryParse * Removing unnecessary nameof expression * Applying review feedback to remove ParseFailureKind from TimeSpanParse * Added helper methods for TimeSpan parsing
2018-04-17Enable generic attributes (#9189)Avi Avni1-5/+5
2018-04-16Dict: Use Ref Local Reassignment (C# 7.3) (#17483)Ben Adams2-8/+4
* Dict: Use Ref Local Reassignment (C# 7.3) * Use lang version latest rather than 7.3
2018-04-16Update xml comment for {ReadOnly}Memory.Pin method (dotnet/corefx#29137) ↵dotnet bot2-2/+8
(#17593) Signed-off-by: dotnet-bot-corefx-mirror <dotnet-bot@microsoft.com>
2018-04-16Changed SpinLock::CompareExchange method declaration to static (#17579)Phil Garcia1-1/+1
2018-04-16Update KoreanLunisolarCalendar.cs (#17542)elyoh1-1146/+1143
* Update KoreanLunisolarCalendar.cs Corrects two issues with the conversion table for Gregorian to Korean lunisolar dates. Issue 1: tables use Julian month/day instead of Gregorian month/day for entries prior to 1583. Lmon and Lday have been converted from Julian month and day to Gregorian month and day for years prior to 1583. This also required a new value for MIN_GREGORIAN_DAY (now 19) so the minimum date now supported by this class is 19 Feb 0918 Gregorian. Issue 2: data discrepancy in years 1586, 1587, 1648, 1659, 1692, 1753 and 1754. Table entries for 1586, 1587, 1648, 1659, 1692, 1753 and 1754 have been corrected to match Korea Astronomy and Space Science In- stitute (KASI) data. Specifically: •for years 1587, 1648, and 1754, the first day of year has been corrected •for years 1586, 1587, 1659, 1692, 1753, and 1754, the lengths of each month have been corrected Notes A minor formatting change to the table has been made. The DaysPerMonth flag has been converted to use the binary literal to ensure that changes can be made and verified easily. See: https://github.com/dotnet/coreclr/issues/17510 for full discussion of changes. * Update KoreanLunisolarCalendar.cs Added comment on sources of table data.
2018-04-13Fix default style argument to Double/Single/Decimal.Parse (#17556)Stephen Toub3-3/+3
2018-04-13Collapse leftover AsSpan().Slice(...) into AsSpan(...) (#29078)Ahson Khan1-1/+1
Signed-off-by: dotnet-bot-corefx-mirror <dotnet-bot@microsoft.com>
2018-04-12Remove CreateFromPinnedArray from Memory (moved to MemoryMarshal) (#17532)Ahson Khan1-31/+0
2018-04-12Use string.IsNullOrEmpty to eliminate bounds check to first char (#17512)Ben Adams1-1/+7
2018-04-11Some cleanup for ArrayPool trimming (#17518)Jeremy Kuhne2-18/+31
* Some cleanup for ArrayPool trimming - fix static names - make config switch more specific - tweak tls free logic for logging * Tweak the name of the config switch
2018-04-11Remove MemoryManager.Length (#17498)Ben Adams2-18/+51
* Remove MemoryManager.Length * Feedback * XML comment nits
2018-04-11Fix CoreRT build breaksJan Kotas2-7/+2
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
2018-04-11Add GetPinnableReference back to Span and ReadOnlySpan (#17504)Ahson Khan2-0/+14
2018-04-11Fix Assert in ValueTask (#17511)Ben Adams1-1/+1