Graham Batty
eaf22e9661
Make malloc_size a platform stub called swift_malloc_size.
...
Swift SVN r22971
2014-10-27 17:16:24 +00:00
Graham Batty
8fc89cd8ff
stdlib: Add implementation of snprintf_l for linux
...
On non-apple platforms, adds an snprintf_l alternate version
that temporarily switches locale.
Swift SVN r22400
2014-09-30 20:15:31 +00:00
Dmitri Hrybenko
7a53df0d37
Remove unused includes
...
Swift SVN r22321
2014-09-28 01:16:14 +00:00
Dmitri Hrybenko
d68a5c4c98
stdlib: finish implementation of atomics for initializing an ARC
...
reference, add tests
Swift SVN r21873
2014-09-11 14:52:58 +00:00
Dmitri Hrybenko
96d00d70b5
StdlibUnittest: add infrastructure for race tests (see examples)
...
This will be used to test rdar://18191358
Swift SVN r21836
2014-09-10 11:58:45 +00:00
Dmitri Hrybenko
44bf1a81a6
stdlib/Printing: print floating point numbers with appropriate precesion for
...
the type
Printing Float32 with %0.15g not only wastes screen space, but also causes
confusion for users, and pretends that a Float32 has more precision than it
actually does.
rdar://18043123
Swift SVN r21435
2014-08-25 13:56:38 +00:00
Dmitri Hrybenko
6d4f8adbf5
stdlib/String: fix a race in _StringBuffer.grow()
...
rdar://17855614
Swift SVN r20960
2014-08-02 22:50:45 +00:00
Ben Langmuir
a0f72c56f1
Change _swift_fmodf to return float
...
Hoping this fixes the armv7 test failures.
Swift SVN r19811
2014-07-10 16:39:08 +00:00
Greg Parker
bde0d301fc
Fix fmod() covers. Add CGFloat to the math.h tests.
...
<rdar://problem/17275152> Can't call C fmodf() from stdlib
Swift SVN r19777
2014-07-10 03:54:27 +00:00
Dmitri Hrybenko
ce14332bb6
stdlib: make UnicodeScalar.escape() independent of current locale
...
Swift SVN r18595
2014-05-23 15:40:47 +00:00
Dmitri Hrybenko
5855c2b34f
stdlib/Printing: remove superfluous newlocale() call
...
Also add tests for post-processing printed results in scientific notation.
Swift SVN r18495
2014-05-21 14:12:31 +00:00
Ted Kremenek
def1f53b7d
Make printing of double's locale-insensitive.
...
I've never used 'newlocale' before, so I may be using it wrong.
Also, this may not be 100% thread safe; worst case we create
multiple locale objects when swift_doubleToString() is called
at the same time. We can fix this if we care.
Swift SVN r18201
2014-05-16 17:43:54 +00:00
Ted Kremenek
178e2a32df
Printing routines should append ".0" to floats, *not* taking locales into account.
...
Implements <rdar://problem/16895801>.
Swift SVN r18185
2014-05-16 07:27:54 +00:00
Dmitri Hrybenko
2ec65be0a6
stdlib/runtime: use a C++ header
...
Swift SVN r18105
2014-05-15 14:14:28 +00:00
Dmitri Hrybenko
4f921ad60b
Unbreak iOS build
...
Swift SVN r18002
2014-05-13 13:27:39 +00:00
Dmitri Hrybenko
2cc8fe40d4
stdlib/printing: replace four printing systems with one new one
...
The old ones were:
- print/println
- printAny
- printf
- Console
The new printing story is just print/println. Every object can be printed.
You can customize the way it is printed by adopting Printable protocol. Full
details in comments inside stdlib/core/OutputStream.swift.
Printing is not completely finished yet. We still have ReplPrintable, which
should be removed, string interpolation still uses String constructors, and
printing objects that don't conform to Printable will result in printing
mangled names.
Swift SVN r18001
2014-05-13 13:07:59 +00:00
Joe Groff
02e95c2866
stdlib: Use #if to clean up platform-dependent branching in VarArgs implementation.
...
NFC, but we kill a needless runtime stub.
Swift SVN r16669
2014-04-22 22:38:15 +00:00
Ted Kremenek
3fff062f8d
Extend print(Double) precision to 15 digits.
...
Double's like '0.9999999' were being printed as '1.0'.
'print' isn't a first-class I/O library anyway; it's main use right
now is accurate reporting in the REPL.
Fixes <rdar://problem/16603548>.
Swift SVN r16305
2014-04-14 07:13:15 +00:00
Dmitri Hrybenko
571c9b3c5e
Split 'type' keyword into 'static' and 'class'
...
rdar://15911697
Swift SVN r13908
2014-02-14 14:50:32 +00:00
Greg Parker
95c2fc43f8
Clena up some 32/64 mismatches. Remove some dead posix stubs.
...
Swift SVN r13144
2014-01-30 09:34:26 +00:00
Doug Gregor
6b8f6a2a9a
Use an ugly series of builtins to eliminate swift_makeUnsafeNil().
...
Swift SVN r13104
2014-01-29 08:17:15 +00:00
Doug Gregor
eaf3e5c68d
Move nil/_Nil into the core library and add UnsafePointer<T> support.
...
Fixes <rdar://problem/15933510>.
Swift SVN r13094
2014-01-29 06:30:28 +00:00
Doug Gregor
0d37bd3015
Switch the standard library from "static" to "type".
...
Swift SVN r12026
2014-01-08 01:09:56 +00:00
Dave Abrahams
afbbbd1287
[stdlib] Add a facility for calling "C" functions that take va_list arguments
...
This code has only been tested on x86_64, but is designed to work on
the other platforms supported by Apple.
Swift SVN r11561
2013-12-22 02:37:33 +00:00
Howard Hinnant
46f26de87b
Inlined countLeadingZeros per Dmitri's suggestion.
...
Swift SVN r9970
2013-11-05 20:20:19 +00:00
Howard Hinnant
ec70f480a6
Set Dictionary up to use only power-of-2 bucket counts. Introduce countLeadingZeros helper to accomplish this. It would be really nice if we could figure out how to inline countLeadingZeros.
...
Swift SVN r9967
2013-11-05 18:52:44 +00:00
Greg Parker
6a1df4bb3f
Remove Int128 because it is unreliable or incomplete on some architectures.
...
Swift SVN r8249
2013-09-14 11:07:27 +00:00
Greg Parker
ebebd988b2
Workaround rdar://14883575 muloti missing from libcompiler_rt on arm64.
...
Swift SVN r8177
2013-09-13 01:25:33 +00:00
Joe Groff
7410a83165
Replace Bool._getBuiltinLogicValue stub with a Swift implementation.
...
We can switch over unions now.
Swift SVN r8114
2013-09-11 22:00:49 +00:00
Greg Parker
1200ef4fab
Move benchmark machinery out of stdlib.
...
Swift SVN r7961
2013-09-05 21:18:23 +00:00
John McCall
6de3df22c2
Define _getBool purely in swift.
...
Swift SVN r7738
2013-08-29 20:34:34 +00:00
Jordan Rose
e1f346b342
Update comment for print_double to mention that NaNs don't need ".0" either.
...
Swift SVN r7655
2013-08-28 00:21:12 +00:00
Jordan Rose
9b42f8f81f
Don't append ".0" to "inf" and "-inf".
...
We may want a prettier representation of floating-point infinities, but
"inf.0" is a particularly bad one.
Swift SVN r7638
2013-08-27 22:41:01 +00:00
Dmitri Hrybenko
0e26015bb2
Splitting the standard library: move POSIX declarations from stdlib/core/Misc.swift to stdlib/POSIX
...
Swift SVN r5890
2013-06-28 23:46:01 +00:00
Dmitri Hrybenko
ea43c46262
Splitting the standard library: move runtime -> stdlib/runtime
...
Swift SVN r5887
2013-06-28 22:41:38 +00:00