Bug 5154 - JSC should switch from Core Foundation to unix time/date functions
Summary: JSC should switch from Core Foundation to unix time/date functions
Status: RESOLVED DUPLICATE of bug 5280
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Darin Adler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-27 11:54 PDT by Geoffrey Garen
Modified: 2005-10-09 14:08 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Geoffrey Garen 2005-09-27 11:54:49 PDT
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.
Comment 1 Alexey Proskuryakov 2005-09-27 13:36:43 PDT
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).
Comment 2 Geoffrey Garen 2005-09-30 08:53:48 PDT
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.
Comment 3 Darin Adler 2005-10-08 23:24:55 PDT
To fix bug 5280, I recommended we do this. And my patch attached to bug 5280 does this.
Comment 4 Geoffrey Garen 2005-10-09 14:08:54 PDT
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 ***