The intent is to use this after having temporarily increased the max dirty page threshold.
This API will be used off the main thread.
Differential Revision: https://phabricator.services.mozilla.com/D220256
The intent is to use this after having temporarily increased the max dirty page threshold.
This API will be used off the main thread.
Differential Revision: https://phabricator.services.mozilla.com/D220256
With heap scan mode, the DMD log includes the address of every block.
This patch includes the addresses in the output, if they are present.
This is useful when no cycle collected objects are leaked.
Differential Revision: https://phabricator.services.mozilla.com/D214880
With heap scan mode, the DMD log includes the address of every block.
This patch includes the addresses in the output, if they are present.
This is useful when no cycle collected objects are leaked.
Differential Revision: https://phabricator.services.mozilla.com/D214880
The Arena ID is wrapped in a Maybe, the construction of Nothing() shows up
in profiles. By testing the maybe we show the compiler that it can optimise
away the construction of Nothing when inlining this code.
Differential Revision: https://phabricator.services.mozilla.com/D207680
+ Move sNow into the PHC class and put it next to mMutex, they're
frequently modified together.
+ Reorganise PHC fields to place frequently-updated-together fields
together, and separate them from the seldom-updated fields.
+ The only static fields remaining are write-once.
Differential Revision: https://phabricator.services.mozilla.com/D210468
This change optimises the PHC hot path by reducing updates to sAllocDelay
and sNow:
* tlsAllocDelay has been created to create thread-local allocation delays,
when they expire then the shared sAllocDelay is checked.
* sNow is updated only when not executing the fast path.
This change also:
* Previously the thread that saw sAllocDelay == 0 would be the one to make
the allocation, the ReleaseAquire semantics ensured that exactly one
thread would see this. Now all threads that see sAllocDelay <= 0 will
attempt a PHC allocation, this is later checked by atomically resetting
sAllocDelay.
* Removes the logic that checks if the delay has wrapped
while PHC was disabled on the current thread. This isn't needed anymore
because we now make PHC allocations for all sAllocDelay < 0, assuming
that threads are disabled for less than UINT32_MAX/2 allocations.
* Moves ShouldMakeNewAllocations out of the hot-path.
Differential Revision: https://phabricator.services.mozilla.com/D206469
This patch co-locates mMutex with the data it protects and is accessed
together. It was previously located with global write-once data and updates
to `sMutex` were caused cache misses for `sPHC`.
Making `mMutex` a member variable also makes sense conceptually.
Differential Revision: https://phabricator.services.mozilla.com/D210466
I know this and some of the other refactoring patches are going to make
things more verbose (eg PHC::sPHC-> prefixing everything). I intend to
follow up later and move more of PHC's code into the PHC class which will
then reduce the need for those pointers and scopes.
Differential Revision: https://phabricator.services.mozilla.com/D210463
This and the refactoring changes to follow are moving more of PHC's data
into one class. From within there we can group it by how its accessed and
control which data is nearby other data to control cache line sharing.
sAllocDelay is always initialised by the GMut() constructor. It is later
re-initialised from SetState() but that could be after PHC is already
active.
Differential Revision: https://phabricator.services.mozilla.com/D206468
Currently we have 3 structures containing mutable data seperated by their
lock-safe behaviour (locked, atomic and TLS). I'd prefer to associate
structures by what they mean. This patch moves the `tlsIsDisabled`
variable, the only one in `GTls` into `GMutable` and removes the `GTls`
class.
Differential Revision: https://phabricator.services.mozilla.com/D206466