mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1130226 - Part 3: Rename mallocBytes to mallocBytesUntilGC; r=sfink
--HG-- extra : rebase_source : e28cd720361d6ebcb8d820c86099c8d9e4229326
This commit is contained in:
parent
c5f76bd296
commit
09c687b420
@ -732,7 +732,7 @@ class GCRuntime
|
||||
|
||||
void setMaxMallocBytes(size_t value);
|
||||
void resetMallocBytes();
|
||||
bool isTooMuchMalloc() const { return mallocBytes <= 0; }
|
||||
bool isTooMuchMalloc() const { return mallocBytesUntilGC <= 0; }
|
||||
void updateMallocCounter(JS::Zone *zone, size_t nbytes);
|
||||
void onTooMuchMalloc();
|
||||
|
||||
@ -1178,11 +1178,11 @@ class GCRuntime
|
||||
* Malloc counter to measure memory pressure for GC scheduling. It runs
|
||||
* from maxMallocBytes down to zero.
|
||||
*/
|
||||
mozilla::Atomic<ptrdiff_t, mozilla::ReleaseAcquire> mallocBytes;
|
||||
mozilla::Atomic<ptrdiff_t, mozilla::ReleaseAcquire> mallocBytesUntilGC;
|
||||
|
||||
/*
|
||||
* Whether a GC has been triggered as a result of mallocBytes falling
|
||||
* below zero.
|
||||
* Whether a GC has been triggered as a result of mallocBytesUntilGC
|
||||
* falling below zero.
|
||||
*/
|
||||
mozilla::Atomic<bool, mozilla::ReleaseAcquire> mallocGCTriggered;
|
||||
|
||||
|
@ -1127,7 +1127,7 @@ GCRuntime::GCRuntime(JSRuntime *rt) :
|
||||
#endif
|
||||
validate(true),
|
||||
fullCompartmentChecks(false),
|
||||
mallocBytes(0),
|
||||
mallocBytesUntilGC(0),
|
||||
mallocGCTriggered(false),
|
||||
alwaysPreserveCode(false),
|
||||
#ifdef DEBUG
|
||||
@ -1655,14 +1655,14 @@ GCRuntime::setMaxMallocBytes(size_t value)
|
||||
void
|
||||
GCRuntime::resetMallocBytes()
|
||||
{
|
||||
mallocBytes = ptrdiff_t(maxMallocBytes);
|
||||
mallocBytesUntilGC = ptrdiff_t(maxMallocBytes);
|
||||
mallocGCTriggered = false;
|
||||
}
|
||||
|
||||
void
|
||||
GCRuntime::updateMallocCounter(JS::Zone *zone, size_t nbytes)
|
||||
{
|
||||
mallocBytes -= ptrdiff_t(nbytes);
|
||||
mallocBytesUntilGC -= ptrdiff_t(nbytes);
|
||||
if (MOZ_UNLIKELY(isTooMuchMalloc()))
|
||||
onTooMuchMalloc();
|
||||
else if (zone)
|
||||
|
Loading…
Reference in New Issue
Block a user