Bug 1130226 - Part 3: Rename mallocBytes to mallocBytesUntilGC; r=sfink

--HG--
extra : rebase_source : e28cd720361d6ebcb8d820c86099c8d9e4229326
This commit is contained in:
Terrence Cole 2015-02-06 08:43:43 -08:00
parent c5f76bd296
commit 09c687b420
2 changed files with 7 additions and 7 deletions

View File

@ -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;

View File

@ -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)