Closed
Bug 463562
Opened 16 years ago
Closed 15 years ago
unnecessary dependency on mmtimer.lib
Categories
(NSPR :: NSPR, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
4.8
People
(Reporter: blassey, Assigned: blassey)
Details
(Keywords: mobile)
Attachments
(2 files, 2 obsolete files)
1.62 KB,
patch
|
pavlov
:
review+
wtc
:
superreview-
|
Details | Diff | Splinter Review |
1.23 KB,
patch
|
Details | Diff | Splinter Review |
we're linking in mmtimer.lib simply to use timeGetTime() for _PR_MD_GET_INTERVAL(). It appears that GetTickCount() will do the same thing without the additional dependency. Additionally, the dependancy on mmtimer is causing nss to fail to load softokn3.dll on wince, resulting in a crash when trying to start an https connection.
Assignee | ||
Comment 1•16 years ago
|
||
Attachment #346842 -
Flags: review?(pavlov)
Comment 2•16 years ago
|
||
Please elaborate on the statement: "the dependancy on mmtimer is causing nss to fail to load softokn3.dll on wince".
Assignee | ||
Comment 3•16 years ago
|
||
softokn3.dll was failing to load with error code 0x7e, which a missing dependency. I looked at the dependency tree with depends.exe and saw that nspr was depending on mmtimer.dll, which I didn't see in my system path. Rebuilding nspr and relinking nss with this patch fixed the problem of softokn3.dll's load failure.
Comment 4•16 years ago
|
||
Comment on attachment 346842 [details] [diff] [review] uses GetTickCount instead of timeGetTime why do we want to do this? timeGetTime has 1ms precision vs GetTickCount which has 10ms.
Comment 6•16 years ago
|
||
(In reply to comment #4) > (From update of attachment 346842 [details] [diff] [review]) > why do we want to do this? > timeGetTime has 1ms precision vs GetTickCount which has 10ms. According to the MSDN documentation, GetTickCount returns a number whose units are milliseconds since startup (mod 2^32), but its resolution is platform dependent, and is said to be 60hz on many WinXXX platforms, meaning that it updates in multiples of 16.66... :) If that's good enough for WinCE, then I think this patch is OK, otherwise... This patch seems to include at least one unrelated file modification.
Assignee | ||
Comment 7•16 years ago
|
||
yes, it does. Please ignore the change to map.cpp
Assignee | ||
Comment 8•16 years ago
|
||
This will use timeGetTime if mmtimer exists, if not it'll fall back on GetTickCount
Attachment #346842 -
Attachment is obsolete: true
Attachment #347331 -
Flags: review?(pavlov)
Attachment #346842 -
Flags: review?(pavlov)
Comment 9•16 years ago
|
||
Comment on attachment 347331 [details] [diff] [review] does a little proc address magic We should seperate this out into two patches -- one for our wince tools, one for nspr? what about the vs8 tools? http://mxr.mozilla.org/mozilla-central/search?string=mmtimer should we put timeGetTime() in the shunt? it seems to also be used in: /js/tamarin/platform/win32/OSDepWin.cpp
Updated•16 years ago
|
Attachment #347331 -
Flags: superreview?(wtc)
Attachment #347331 -
Flags: review?(pavlov)
Attachment #347331 -
Flags: review+
Comment 10•16 years ago
|
||
Comment on attachment 347331 [details] [diff] [review] does a little proc address magic This code dynamically loads a system library under some circumstances. Where's the code to do the corresponding unload when NSPR is shut down?
Assignee | ||
Comment 11•16 years ago
|
||
according to msdn:
> The system maintains a per-process reference count on all loaded modules.
> Calling LoadLibrary increments the reference count. Calling the FreeLibrary or
> FreeLibraryAndExitThread function decrements the reference count. The system
> unloads a module when its reference count reaches zero or when the process
> terminates (regardless of the reference count).
I believe the unload on process termination is the behavior we want
Comment 12•16 years ago
|
||
Fennec may desire this behavior, but I don't believe that means that all users of NSPR on WinCE will. In general, it is not the practice of NSPR to leak dynamically loaded libraries. Shutting down NSPR should leave the process very much in the same state as before NSPR is initialized.
Comment 13•16 years ago
|
||
Comment on attachment 347331 [details] [diff] [review] does a little proc address magic You should initialize 'intervalFunc' in _PR_MD_INTERVAL_INIT(), which is called once during NSPR initialization. The way you initialize 'intervalFunc' lazily in _PR_MD_GET_INTERVAL() may not be thread-safe. You can also consider just using GetTickCount. It's usually bad to behave differently on different machines unless the feature is highly desirable.
Attachment #347331 -
Flags: superreview?(wtc) → superreview-
Comment 14•16 years ago
|
||
Brad, please review and test this NSPR patch.
Attachment #347689 -
Flags: review?(blassey)
Assignee | ||
Comment 15•16 years ago
|
||
Wan-Teh, I've got your patch in my tree but can't test it right now because of a js crash.
Assignee | ||
Comment 16•16 years ago
|
||
Comment on attachment 347689 [details] [diff] [review] NSPR patch v2 looks good and works for me
Attachment #347689 -
Flags: review?(blassey) → review+
Comment 17•16 years ago
|
||
I added an XXX comment to note that the mmtimer.dll library handle is leaked. I checked in the patch on the NSPR trunk (NSPR 4.7.4). Checking in ntinrval.c; /cvsroot/mozilla/nsprpub/pr/src/md/windows/ntinrval.c,v <-- ntinrval.c new revision: 3.14; previous revision: 3.13 done This will eventually make it into mozilla-central. Brad, you need to check in your change to build/wince/tools/vs9ppc2003arm/arm-wince-link.c yourself.
Attachment #347689 -
Attachment is obsolete: true
Comment 18•15 years ago
|
||
I'm targetting Windows CE support at NSPR 4.8 now. So the NSPR patch v2 (attachment 349479 [details] [diff] [review]) won't be in NSPR 4.7.4. (This is just a version number change. Don't worry about it.)
Target Milestone: --- → 4.8
Assignee | ||
Updated•15 years ago
|
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•