gecko-dev/memory/replace
Mike Hommey 1f75d81c1c Bug 1417234 - Use SRWLock as Mutex for mozjemalloc on Windows. r=njn
SRWLock is more lightweight than CriticalSection, but is only available
on Windows Vista and more. So until we actually dropped support Windows
XP, we had to use CriticalSection.

Now that all supported Windows versions do have SRWLock, this is a
switch we can make, and not only because SRWLock is more lightweight,
but because it can be statically initialized like on other platforms,
allowing to use the same initialization code as on other platforms,
and removing the requirement for a DllMain, which in turn can allow
to statically link mozjemalloc in some cases, instead of requiring a
shared library (DllMain only works on shared libraries), or manually
call the initialization function soon enough.

There is a downside, though: SRWLock, as opposed to CriticalSection, is
not fair, meaning it can have thread scheduling implications, and can
theoretically increase latency on some threads. However, it is the
default used by Rust Mutex, meaning it's at least good enough there.
Let's see how things go with this.

--HG--
extra : rebase_source : 337dc4e245e461fd0ea23a2b6b53981346a545c6
2017-11-14 12:58:33 +09:00
..
dmd Bug 1384814 - Remove critical address machinery from Mac implementation of MozStackWalk(). r=glandium. 2017-10-03 13:53:14 +11:00
logalloc Bug 1417234 - Use SRWLock as Mutex for mozjemalloc on Windows. r=njn 2017-11-14 12:58:33 +09:00
moz.build Bug 1401101 - Remove the generic replace-malloc library. r=njn 2017-09-19 15:58:33 +09:00