16 Commits

Author SHA1 Message Date
Tina Liu
963de657e9
Do not cache NSLocale.current if we fail to fetch preferences (#1134)
Currently, we do not cache the current Swift locale if we cannot fetch proper preferences. This allows us to update the cached value if subsequent access succeeds.

We should be doing that for `currentNSLocale` too, but we are not. Fix the logic so that the behaviors match.

Resolves rdar://142699797
2025-01-23 09:15:46 -08:00
Tony Parker
446af5c0c5
Formatting performance improvements (#884) 2024-08-23 14:13:17 -07:00
Jeremy Schonfeld
196376b5fd
Use dynamic replacement instead of _typeByName for internationalization upcalls (#756)
* Use dynamic replacement instead of _typeByName for internationalization upcalls

* Make FOUNDATION_FRAMEWORK function non-dynamic

* Fix build failures
2024-07-23 14:43:01 -07:00
Tony Parker
90109a4cf6
Revert formatting performance improvements (#744)
There appears to be some kind of race or memory smash in ICU after these, and we need more time to investigate the full root cause.
2024-07-18 17:43:34 -07:00
Tony Parker
6ee772ba7f
Improve performance of FormatStyle formatting when used in multithreaded context (#719)
* Improve performance of FormatStyle formatting when used in multithreaded context

* Change canImport statement to support newer SDK on older macOS
2024-07-09 10:06:47 -07:00
Charles Hu
60506f3af4
Renamed _CShims to _FoundationCShims (#656)
Rationale: _CShims will effectivly become semi-public in the toolchain. We add the Foundation prefix to make it less generic.
2024-06-21 16:18:38 -07:00
Tony Parker
caa08cf226
Enable complete concurrency checking in Foundation 2024-06-04 10:41:59 -07:00
Charles Hu
6566925d60
Update remaining references of FoundationICU to _FoundationICU (#649) 2024-06-03 14:59:28 -07:00
Charles Hu
2a8e9438ec
Upgrade FoundationICU to 0.0.7 (#645) 2024-05-31 13:50:07 -07:00
Tina Liu
cf8019baf6
Calendar.startOfDay(for:) preformance regression (#500)
We re-construct a `Locale` everytime `calendar.locale` getter is called with `Locale(identifier:preferences:)`. When `preferences == nil`, this "preference-carried" `Locale` should behave exactly the same as a "fixed" locale.

Since we cache all fixed locale by their identifiers already, we should just return one from the cache instead of creating a brand new one. This allows us to reuse all precomputed values and avoid having to call into ICU repeatedly.

124868926
2024-03-25 13:17:48 -07:00
Jeremy Schonfeld
e5211f2926
(122981400) Standardize on using internal import 2024-03-06 13:42:02 -08:00
Tony Parker
c418cf8c3b
Rebase ISO8601 formatting on top of new Gregorian Calendar implementation (#392) 2024-01-30 10:22:15 -08:00
Tony Parker
cef4ea4865
Make sure to turn off bundle matching when resetting the autoupdating locale for testing purposes. (#347)
Follow up for #342
2023-12-18 13:28:37 -08:00
Tony Parker
18ac5ac575
Do not attempt to cache based on a signature that uses a Locale (#334)
* Fix a bug where use of autoupdatingCurrentLocale with number formatters resulted in not-autoupdating behavior

* Remove tests for Measurement in package
2023-12-04 09:34:37 -08:00
Charles Hu
7272a47c0b
Refactoring some import conditions (#298) 2023-10-25 15:11:37 -07:00
Tony Parker
d942713680
Sink TimeZone, Locale, Calendar to Essentials (#266)
* Sink Locale, Calendar to Essentials

* Add a Calendar test, make sure that _lock is populated early for NSSwiftCalendar
2023-09-25 16:09:16 -07:00