summaryrefslogtreecommitdiff
path: root/src/System.Private.CoreLib/shared/System/Buffers
AgeCommit message (Collapse)AuthorFilesLines
2019-01-30Reverting "Fixing up the UTF8Formatter and some tests to properly handle ↵Tanner Gooding1-0/+6
-0.0" (#22300)
2019-01-17Avoid allocations in Utf8Formatter.TryFormat(float/double, ...) (#22011)Stephen Toub2-41/+81
* Avoid allocations in Utf8Formatter.TryFormat(float/double, ...) Currently every call to Utf8Formatter.TryFormat for a float or a double allocates two strings, one for the format string and one for the resulting number. This avoids those in the common case where we can use float/double.TryFormat and format directly into a stack buffer. Also removes some unsafe code; the performance of StandardFormat.ToString isn't currently worth the extra nanoseconds gained by using unsafe code. * Delete assert There's a test that uses unsafe code to cause this to fail and validate that no exception is thrown.
2019-01-09Move OperationStatus into shared source (#21912)Levi Broderick1-0/+34
This is the first step to moving OperationStatus from corefx into coreclr. It'll be used by the transcoding APIs which live in System.Private.CoreLib.
2018-12-04Merge pull request #21356 from stephentoub/xmlcommentsStephen Toub1-2/+2
Fix lots of malformed XML comments
2018-12-04Fix lots of malformed XML commentsStephen Toub1-2/+2
These are causing errors in the source.dot.net build. Turning on DocumentationFile and suppressing 1591, 1573, and 0419, Corelib builds clean after these changes.
2018-12-03Merge pull request #21264 from fiigii/x64onlyCarol Eidt1-2/+2
Implement 64-bit-only hardware intrinsic
2018-11-30Migrate FormattingHelpers.CountDigits to using Lzcnt.X64Fei Peng1-2/+2
2018-11-29Added TryParse to StandardFormat (#21216)Alexej Liebenthal1-11/+32
2018-11-28Fixing up Utf8Parser.TryParseNumber to not fail for overly large exponents ↵Tanner Gooding1-3/+8
(#21233)
2018-11-26Handle the remaining known issues (modulo snan) with the double/single ↵Tanner Gooding3-34/+84
parsing logic (#21036) * Fixing the double/single parser to return negative zero for `-0` * Updating the Utf8Parser to allow exponents of arbitrary length * Updating the double/single parser to support case-insensitive and signed infinity/nan * Ensure TryParseAsSpecialFloatingPoint handles the case where we have an empty source * Fixing the number parser to allow `-0` for decimal and to not parse '++infini'
2018-11-12Fixing Utf8Parser.Number to not modify the value of 'c' (#20967)Tanner Gooding1-4/+6
2018-11-12Moving the Utf8Formatter and Utf8Parser into S.P.Corelib (#20934)Tanner Gooding22-63/+154
* Moving the Utf8Formatter and Utf8Parser into S.P.Corelib * Doing some minimal cleanup to lineup types and get the Utf8Parser/Utf8Formatter building * Updating the Utf8 Float Parser to have different buffers for Single vs Double * Fixing the Utf8Parser to track trailing zero digits and to properly mark the end of the buffer * Fixing a couple of issues in Utf8Parser.Number
2018-11-10Fix invalid out of range exception thrown in ArrayPool trimming (#20932)Stephen Toub1-5/+5
The trim method had the wrong logic to get the relevant bucket size, resulting in InvalidOutOfRangeException exceptiosn being thrown and eaten on the finalizer thread.
2018-11-09Moving the Utf8Parser/Utf8Formatter to be shared (dotnet/corefx#33348)Tanner Gooding50-0/+7699
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
2018-11-05Add support for BSWAP intrinsic (#18398)Levi Broderick1-5/+8
With this change, the JIT will recognize a call to BinaryPrimitives.ReverseEndianness and will emit a bswap instruction. This logic is currently only hooked up for x86 and x64; ARM still uses fallback logic. If the JIT can't emit a bswap instruction (for example, trying to emit a 64-bit bswap in a 32-bit process), it will fall back to a software implementation, so the APIs will work across all architectures.
2018-10-26Allow ArrayPool.Shared devirtualization (redux) (#20637)Ben Adams1-1/+5
2018-10-25Optimize FormattingHelpers.CountHexDigits using Lzcnt.LeadingZeroCount (#19006)Egor Bogatov2-2/+12
* Optimize CountHexDigits using Lzcnt * shift bits instead * use Lzcnt only on 64 bit * Optimize Buffer.Utilities.SelectBucketIndex() * #if HAS_INTRINSICS * remove HAS_INTRINSICS * remove HAS_INTRINSICS
2018-10-06Move BinaryPrimitives into coreclr shared source (#20288)Levi Broderick5-0/+871
2018-07-20Improve throughput of TimeSpan.ToString/TryFormat with "g"/"G" (#19051)Stephen Toub1-0/+29
* Improve throughput of TimeSpan.ToString/TryFormat with "g"/"G" TimeSpan has three standard formats: "c", "g", and "G". Yesterday I updated its implementation with throughput improvements for "c" (the default) based on porting the design from Utf8Formatter; this PR does so for "g"/"G". Initially I wasn't going to handle "g"/"G" as they factor in culture (Utf8Formatter doesn't), but even with accessing the current culture there are still significant wins to be had. I was also going to keep the "c" and "g"/"G" implementations separate, to avoid bogging down the default "c" formatting with additional conditions needed to support "g"/"G", but the overhead incurred for that turns out to be minimal enough that it's worth keeping one implementation rather than two mostly-similar ones... the impact on "c" is mostly within noise. This PR makes a significant throughput improvement for "g"/"G" formatting. It also removes several unnecessary allocations, such that TryFormat with "g"/"G" is now allocation-free (and ToString just allocates the asked-for string). * Address PR feedback
2018-05-21Code cleanup and formatting for System.Memory files. (#17451)Ahson Khan2-2/+0
* Fix IDE0034 C# expression can be simplified (use of default) * Remove unnecessary using statements * IDE0012 C# Name can be simplified. String -> string * IDE0041 C# Null check can be simplified * Fix code formatting (limited to Span/System.Memory files). * Address PR feedback - IDE0012 Name can be simplified (String -> string) * Add back the necessary using statements and fix typo * Fix comment typo and add necessary using statements
2018-05-08Rename mscorlib to System.Private.Corelib (#17926)Maryam Ariyan10-0/+1312
* diff from just renaming folder mscorlib to System.Private.CoreLib * Updating build.proj to reflect name change Fixes: #17905