Bug 1382099 - Remove MOZ_WIDGET_GONK from memory/. r=glandium.
authorNicholas Nethercote <nnethercote@mozilla.com>
Wed, 19 Jul 2017 18:39:00 +1000
changeset 418522 d11f37fe35f751626aac85b9a5ae0173349204b0
parent 418521 bd8cce1617e8a1f31521cd26980d9af4cf1cc8cf
child 418523 6ceb35ece00dfc9f843b7b35c4aa559c2d1cb480
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1382099
milestone56.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
Bug 1382099 - Remove MOZ_WIDGET_GONK from memory/. r=glandium.
memory/build/mozmemory_wrap.h
memory/volatile/tests/TestVolatileBuffer.cpp
--- a/memory/build/mozmemory_wrap.h
+++ b/memory/build/mozmemory_wrap.h
@@ -136,17 +136,17 @@
 #    if defined(XP_WIN)
 #      if defined(MOZ_REPLACE_MALLOC)
 #        define mozmem_malloc_impl(a)   a ## _impl
 #      else
 #        define mozmem_malloc_impl(a)   je_ ## a
 #      endif
 #    else
 #      define MOZ_MEMORY_API MOZ_EXTERN_C MFBT_API
-#      if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK)
+#      if defined(MOZ_WIDGET_ANDROID)
 #        define MOZ_WRAP_NEW_DELETE
 #      endif
 #    endif
 #  endif
 #  ifdef XP_WIN
 #    define mozmem_dup_impl(a)      wrap_ ## a
 #  endif
 #endif
--- a/memory/volatile/tests/TestVolatileBuffer.cpp
+++ b/memory/volatile/tests/TestVolatileBuffer.cpp
@@ -63,24 +63,17 @@ TEST(VolatileBufferTest, RealVolatileBuf
     VolatileBufferPtr<char> ptr(buf);
 
     EXPECT_FALSE(ptr.WasBufferPurged())
       << "Buffer was immediately purged after unlock";
     EXPECT_STREQ(ptr, teststr) << "Buffer failed to retain data after unlock";
   }
 
   // Test purging if we know how to
-#if defined(MOZ_WIDGET_GONK)
-  // This also works on Android, but we need root.
-  int fd = open("/" ASHMEM_NAME_DEF, O_RDWR);
-
-  ASSERT_GE(fd, 0) << "Failed to open ashmem device";
-  ASSERT_GE(ioctl(fd, ASHMEM_PURGE_ALL_CACHES, NULL), 0)
-    << "Failed to purge ashmem caches";
-#elif defined(XP_DARWIN)
+#if defined(XP_DARWIN)
   int state;
   vm_purgable_control(mach_task_self(), (vm_address_t)NULL,
                       VM_PURGABLE_PURGE_ALL, &state);
 #else
   return;
 #endif
 
   EXPECT_GT(buf->NonHeapSizeOfExcludingThis(), 0ul)