Bug 5154

Summary: JSC should switch from Core Foundation to unix time/date functions
Product: WebKit Reporter: Geoffrey Garen <ggaren>
Component: JavaScriptCoreAssignee: Darin Adler <darin>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: ap, darin
Priority: P2    
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   

Geoffrey Garen
Reported 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.
Attachments
Alexey Proskuryakov
Comment 1 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).
Geoffrey Garen
Comment 2 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.
Darin Adler
Comment 3 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.
Geoffrey Garen
Comment 4 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 ***
Note You need to log in before you can comment on or make changes to this bug.