mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-29 11:57:32 +09:00
Issue #1240 - Part 3b - Implement WrappingOperations.h for wraparound math operations & conversions. https://bugzilla.mozilla.org/show_bug.cgi?id=1441657 Implement mozilla::WrappingMultiply. Prerequisite for our V8 fast forward.
This commit is contained in:
parent
ddd49121a6
commit
d42d5ce138
7 changed files with 328 additions and 10 deletions
|
|
@ -11,6 +11,7 @@
|
|||
#include "mozilla/Casting.h"
|
||||
#include "mozilla/FloatingPoint.h"
|
||||
#include "mozilla/TypeTraits.h"
|
||||
#include "mozilla/WrappingOperations.h"
|
||||
|
||||
#include <math.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
#include "mozilla/Scoped.h"
|
||||
#include "mozilla/TemplateLib.h"
|
||||
#include "mozilla/UniquePtr.h"
|
||||
#include "mozilla/WrappingOperations.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
|
@ -539,7 +540,7 @@ ScrambleHashCode(HashNumber h)
|
|||
* are stored in a hash table; see Knuth for details.
|
||||
*/
|
||||
static const HashNumber goldenRatio = 0x9E3779B9U;
|
||||
return h * goldenRatio;
|
||||
return mozilla::WrappingMultiply(h, goldenRatio);
|
||||
}
|
||||
|
||||
} /* namespace detail */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue