Commit 7559a70a authored by Nicholas Nethercote's avatar Nicholas Nethercote
Browse files

Bug 715453 - Remove computedSize from nsMallocSizeOfFun. r=jlebar,bhackett.

--HG--
extra : rebase_source : a65039a407daab45360a5b375b53cbf1bc05b7f6
parent a9d50842
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -102,12 +102,10 @@ NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(HunspellMallocSizeOfForCounterInc, "hunspel
NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN_UN(HunspellMallocSizeOfForCounterDec)

void HunspellReportMemoryAllocation(void* ptr) {
  // |computedSize| is zero because we don't know what it is.
  gHunspellAllocatedSize += HunspellMallocSizeOfForCounterInc(ptr, 0);
  gHunspellAllocatedSize += HunspellMallocSizeOfForCounterInc(ptr);
}
void HunspellReportMemoryDeallocation(void* ptr) {
  // |computedSize| is zero because we don't know what it is.
  gHunspellAllocatedSize -= HunspellMallocSizeOfForCounterDec(ptr, 0);
  gHunspellAllocatedSize -= HunspellMallocSizeOfForCounterDec(ptr);
}
static PRInt64 HunspellGetCurrentAllocatedSize() {
  return gHunspellAllocatedSize;
+1 −4
Original line number Diff line number Diff line
@@ -5279,10 +5279,7 @@ gfxTextRun::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf)
size_t
gfxTextRun::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf)
{
    // The second arg is how much gfxTextRun::AllocateStorageForTextRun would
    // have allocated, given the character count of this run.
    return aMallocSizeOf(this, sizeof(gfxTextRun) + sizeof(CompressedGlyph) * GetLength()) +
           SizeOfExcludingThis(aMallocSizeOf);
    return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
}


+1 −1
Original line number Diff line number Diff line
@@ -2105,7 +2105,7 @@ private:
        }

        size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) {
            return aMallocSizeOf(this, sizeof(DetailedGlyphStore)) +
            return aMallocSizeOf(this) +
                mDetails.SizeOfExcludingThis(aMallocSizeOf) +
                mOffsetToIndex.SizeOfExcludingThis(aMallocSizeOf);
        }
+4 −4
Original line number Diff line number Diff line
@@ -658,11 +658,11 @@ class HashTable : private AllocPolicy
    }

    size_t sizeOfExcludingThis(JSMallocSizeOfFun mallocSizeOf) const {
        return mallocSizeOf(table, capacity() * sizeof(Entry));
        return mallocSizeOf(table);
    }

    size_t sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf) const {
        return mallocSizeOf(this, sizeof(HashTable)) + sizeOfExcludingThis(mallocSizeOf);
        return mallocSizeOf(this) + sizeOfExcludingThis(mallocSizeOf);
    }

    Ptr lookup(const Lookup &l) const {
@@ -1072,7 +1072,7 @@ class HashMap
         * Don't just call |impl.sizeOfExcludingThis()| because there's no
         * guarantee that |impl| is the first field in HashMap.
         */
        return mallocSizeOf(this, sizeof(*this)) + impl.sizeOfExcludingThis(mallocSizeOf);
        return mallocSizeOf(this) + impl.sizeOfExcludingThis(mallocSizeOf);
    }

    /*
@@ -1282,7 +1282,7 @@ class HashSet
         * Don't just call |impl.sizeOfExcludingThis()| because there's no
         * guarantee that |impl| is the first field in HashSet.
         */
        return mallocSizeOf(this, sizeof(*this)) + impl.sizeOfExcludingThis(mallocSizeOf);
        return mallocSizeOf(this) + impl.sizeOfExcludingThis(mallocSizeOf);
    }

    /*
+1 −1
Original line number Diff line number Diff line
@@ -866,7 +866,7 @@ RoundUpPow2(size_t x)
/*
 * This is SpiderMonkey's equivalent to |nsMallocSizeOfFun|.
 */
typedef size_t(*JSMallocSizeOfFun)(const void *p, size_t computedSize);
typedef size_t(*JSMallocSizeOfFun)(const void *p);

/* sixgill annotation defines */
#ifndef HAVE_STATIC_ANNOTATIONS
Loading