Bug 1175999 - Deallocate mach SharedMemory properly. r=blassey.
authorMike Conley <mconley@mozilla.com>
Thu, 18 Jun 2015 13:57:51 -0400
changeset 280402 656ea3bfbb4ebc7273001d31d8d00fce04fa83e2
parent 280401 69d63551c4dd6f48ff0fa9b9ebd102ed859904ec
child 280408 2694ff2ace6a1b5f6d283c5eafafac730487b189
child 280437 92faa039f31b16d6de95cc3355688d8f492e8bae
push id4932
push userjlund@mozilla.com
push dateMon, 10 Aug 2015 18:23:06 +0000
treeherdermozilla-beta@6dd5a4f5f745 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersblassey
bugs1175999
milestone41.0a1
first release with
nightly mac
656ea3bfbb4e / 41.0a1 / 20150618134629 / files
nightly linux32
nightly linux64
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly mac
Bug 1175999 - Deallocate mach SharedMemory properly. r=blassey. We were deallocating very small regions instead of the entire region we had originally allocated. Mamma mia!
ipc/glue/SharedMemoryBasic_mach.cpp
--- a/ipc/glue/SharedMemoryBasic_mach.cpp
+++ b/ipc/glue/SharedMemoryBasic_mach.cpp
@@ -596,17 +596,17 @@ SharedMemoryBasic::ShareToProcess(base::
 
 void
 SharedMemoryBasic::Unmap()
 {
   if (!mMemory) {
     return;
   }
   vm_address_t address = toVMAddress(mMemory);
-  kern_return_t kr = vm_deallocate(mach_task_self(), address, vm_page_size);
+  kern_return_t kr = vm_deallocate(mach_task_self(), address, round_page(mMappedSize));
   if (kr != KERN_SUCCESS) {
     LOG_ERROR("Failed to deallocate shared memory. %s (%x)\n",  mach_error_string(kr), kr);
     return;
   }
   mMemory = nullptr;
 }
 
 void