Closed Bug 1014111 Opened 10 years ago Closed 10 years ago

Firefox only uses 32-bits of the 64-bits that GetTickCount actually returns.

Categories

(Core :: General, defect)

30 Branch
x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: nick.lowe, Unassigned)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:30.0) Gecko/20100101 Firefox/30.0 (Beta/Release)
Build ID: 20140515140857

Steps to reproduce:

In at least Windows XP SP2 and Server 2003 SP1, which Firefox now requires, GetTickCount actually returns a 64-bit value via the normal calling conventions and not a 32-bit one.

We can validate this with a debugger:

The return value is written in to EAX (low part) and EDX (high part).
Under 64-bit Windows, it is additionally written to RAX.

While this is undocumented behaviour, Mozilla should consider taking advantage of this where GetTickCount64 is not available for cleaner logic that does not have to cope with overflows that occur relatively frequently in the tick count.

This behaviour will not change now in Windows XP or Server 2003 due to their support status and it has been long established.

GetTickCount64 that is documented as returns a 64-bit value only became available with Windows Vista.


Actual results:

Firefox presently uses only the lower 32-bits that are returned from GetTickCount in its sources where GetTickCount64 is not available.


Expected results:

Firefox should be enhanced to use the full 64-bits that are actually returned from GetTickCount in Windows XP SP2/SP3 And Server 2003 SP1/SP2.
Component: Untriaged → General
Product: Firefox → Core
OS: Mac OS X → Windows XP
As I didn't state this, the implementation therefore actually returns a ULARGE_INTEGER and not a DWORD.
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.