Bug 5154
Summary: | JSC should switch from Core Foundation to unix time/date functions | ||
---|---|---|---|
Product: | WebKit | Reporter: | Geoffrey Garen <ggaren> |
Component: | JavaScriptCore | Assignee: | Darin Adler <darin> |
Status: | RESOLVED DUPLICATE | ||
Severity: | Normal | CC: | ap, darin |
Priority: | P2 | ||
Version: | 420+ | ||
Hardware: | Mac | ||
OS: | OS X 10.4 |
Geoffrey Garen
There are two parts to this task:
1. Change e.g. localtime calls to e.g. localtime_r calls.
2. Remove Core Foundation calls and replace with true unix calls.
The CF stuff was a performance hack that we no longer need.
The non-_r time/date functions are not thread-safe or re-entrant. This can cause surprising bugs due to
more than one time/date call in the same call stack or using date code on multiple threads.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Alexey Proskuryakov
Actually, on Darwin, localtime() uses a per-thread global <http://darwinsource.opendarwin.org/10.4.2/
Libc-391/stdtime/FreeBSD/localtime.c>. A lot of other functions that used to operate on static globals do
the same.
MS Windows doesn't have localtime_r at all (if Windows portability is a concern).
Geoffrey Garen
OK, thread safety is no longer a concern. The call stack problem remains, but I suppose that just calls for
careful coding.
So, let's use this bug just to track the switch away from CF calls.
Darin Adler
To fix bug 5280, I recommended we do this. And my patch attached to bug 5280 does this.
Geoffrey Garen
Changing the bug name to reflect that the remaining work is to switch away from CF calls.
*** This bug has been marked as a duplicate of 5280 ***