Bustage fix for bug 1131776, s/moz_malloc/malloc/ on CLOSED TREE
authorBen Turner <bent.mozilla@gmail.com>
Tue, 31 Mar 2015 16:27:36 -0700
changeset 236902 bfa0009deb1e0cede13c62a62b25d9bcd92254f9
parent 236901 32ee4ace1a31fd7add3b4074afec61a4bbb6e8b4
child 236903 e942133b1f9bc221da97c31b28d3560050613260
push id57807
push userbturner@mozilla.com
push dateTue, 31 Mar 2015 23:28:25 +0000
treeherdermozilla-inbound@bfa0009deb1e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1131776
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bustage fix for bug 1131776, s/moz_malloc/malloc/ on CLOSED TREE
dom/indexedDB/ActorsParent.cpp
--- a/dom/indexedDB/ActorsParent.cpp
+++ b/dom/indexedDB/ActorsParent.cpp
@@ -245,27 +245,27 @@ const int32_t kDEBUGThreadPriority = nsI
 const uint32_t kDEBUGThreadSleepMS = 0;
 
 const int32_t kDEBUGTransactionThreadPriority =
   nsISupportsPriority::PRIORITY_NORMAL;
 const uint32_t kDEBUGTransactionThreadSleepMS = 0;
 
 #endif
 
-struct MozFreeDeleter
+struct FreeDeleter
 {
   void
   operator()(void* aPtr) const
   {
-    moz_free(aPtr);
+    free(aPtr);
   }
 };
 
 template <typename T>
-using UniqueMozFreePtr = UniquePtr<T, MozFreeDeleter>;
+using UniqueFreePtr = UniquePtr<T, FreeDeleter>;
 
 template <size_t N>
 MOZ_CONSTEXPR size_t
 LiteralStringLength(const char (&aArr)[N])
 {
   static_assert(N, "Zero-length string literal?!");
 
   // Don't include the null terminator.
@@ -716,19 +716,19 @@ ReadCompressedIndexId(const uint8_t** aI
   MOZ_ASSERT(UINT64_MAX / 2 >= uint64_t(indexId), "Bad index id!");
 
   *aIndexId = int64_t(indexId / 2);
 }
 
 // static
 nsresult
 MakeCompressedIndexDataValues(
-                          const FallibleTArray<IndexDataValue>& aIndexValues,
-                          UniqueMozFreePtr<uint8_t>& aCompressedIndexDataValues,
-                          uint32_t* aCompressedIndexDataValuesLength)
+                             const FallibleTArray<IndexDataValue>& aIndexValues,
+                             UniqueFreePtr<uint8_t>& aCompressedIndexDataValues,
+                             uint32_t* aCompressedIndexDataValuesLength)
 {
   MOZ_ASSERT(!NS_IsMainThread());
   MOZ_ASSERT(!IsOnBackgroundThread());
   MOZ_ASSERT(!aCompressedIndexDataValues);
   MOZ_ASSERT(aCompressedIndexDataValuesLength);
 
   PROFILER_LABEL("IndexedDB",
                  "MakeCompressedIndexDataValues",
@@ -767,18 +767,18 @@ MakeCompressedIndexDataValues(
     if (NS_WARN_IF(UINT32_MAX - infoLength < blobDataLength)) {
       IDB_REPORT_INTERNAL_ERR();
       return NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR;
     }
 
     blobDataLength += infoLength;
   }
 
-  UniqueMozFreePtr<uint8_t> blobData(
-    static_cast<uint8_t*>(moz_malloc(blobDataLength)));
+  UniqueFreePtr<uint8_t> blobData(
+    static_cast<uint8_t*>(malloc(blobDataLength)));
   if (NS_WARN_IF(!blobData)) {
     IDB_REPORT_INTERNAL_ERR();
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
   uint8_t* blobDataIter = blobData.get();
 
   for (uint32_t arrayIndex = 0; arrayIndex < arrayLength; arrayIndex++) {
@@ -2719,17 +2719,17 @@ InsertIndexDataValuesFunction::OnFunctio
     IDB_REPORT_INTERNAL_ERR();
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
   MOZ_ALWAYS_TRUE(
     indexValues.InsertElementSorted(IndexDataValue(indexId, !!unique, value)));
 
   // Compress the array.
-  UniqueMozFreePtr<uint8_t> indexValuesBlob;
+  UniqueFreePtr<uint8_t> indexValuesBlob;
   uint32_t indexValuesBlobLength;
   rv = MakeCompressedIndexDataValues(indexValues,
                                      indexValuesBlob,
                                      &indexValuesBlobLength);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
@@ -2945,18 +2945,18 @@ UpgradeKeyFunction::OnFunctionCall(mozIS
   const uint8_t* blobData;
   uint32_t blobDataLength;
   nsresult rv = aValues->GetSharedBlob(0, &blobDataLength, &blobData);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   // Upgrading the key doesn't change the amount of space needed to hold it.
-  UniqueMozFreePtr<uint8_t> upgradedBlobData(
-    static_cast<uint8_t*>(moz_malloc(blobDataLength)));
+  UniqueFreePtr<uint8_t> upgradedBlobData(
+    static_cast<uint8_t*>(malloc(blobDataLength)));
   if (NS_WARN_IF(!upgradedBlobData)) {
     IDB_REPORT_INTERNAL_ERR();
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
   rv = CopyAndUpgradeKeyBuffer(blobData,
                                blobData + blobDataLength,
                                upgradedBlobData.get());
@@ -15988,17 +15988,17 @@ DatabaseOperationBase::UpdateIndexValues
   MOZ_ASSERT(aConnection);
   aConnection->AssertIsOnConnectionThread();
   MOZ_ASSERT(!aObjectStoreKey.IsUnset());
 
   PROFILER_LABEL("IndexedDB",
                  "DatabaunseOperationBase::UpdateIndexValues",
                  js::ProfileEntry::Category::STORAGE);
 
-  UniqueMozFreePtr<uint8_t> indexDataValues;
+  UniqueFreePtr<uint8_t> indexDataValues;
   uint32_t indexDataValuesLength;
   nsresult rv = MakeCompressedIndexDataValues(aIndexValues,
                                               indexDataValues,
                                               &indexDataValuesLength);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
@@ -20005,17 +20005,17 @@ UpdateIndexDataValuesFunction::OnFunctio
     const uint8_t* blobData;
     uint32_t blobDataLength;
     rv = aValues->GetSharedBlob(1, &blobDataLength, &blobData);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
 
     std::pair<uint8_t *, int> copiedBlobDataPair(
-      static_cast<uint8_t*>(moz_malloc(blobDataLength)),
+      static_cast<uint8_t*>(malloc(blobDataLength)),
       blobDataLength);
 
     if (!copiedBlobDataPair.first) {
       IDB_REPORT_INTERNAL_ERR();
       return NS_ERROR_OUT_OF_MEMORY;
     }
 
     memcpy(copiedBlobDataPair.first, blobData, blobDataLength);
@@ -20053,17 +20053,17 @@ UpdateIndexDataValuesFunction::OnFunctio
     const IndexUpdateInfo& info = updateInfos[index];
 
     MOZ_ALWAYS_TRUE(
       indexValues.InsertElementSorted(IndexDataValue(metadata.id(),
                                                      metadata.unique(),
                                                      info.value())));
   }
 
-  UniqueMozFreePtr<uint8_t> indexValuesBlob;
+  UniqueFreePtr<uint8_t> indexValuesBlob;
   uint32_t indexValuesBlobLength;
   rv = MakeCompressedIndexDataValues(indexValues,
                                      indexValuesBlob,
                                      &indexValuesBlobLength);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }