[compiler-rt] r359803 - [compiler-rt] Set the ZX_VMO_RESIZABLE option for zx_vmo_create

Petr Hosek via llvm-commits llvm-commits at lists.llvm.org
Thu May 2 10:24:54 PDT 2019


Author: phosek
Date: Thu May  2 10:24:53 2019
New Revision: 359803

URL: http://llvm.org/viewvc/llvm-project?rev=359803&view=rev
Log:
[compiler-rt] Set the ZX_VMO_RESIZABLE option for zx_vmo_create

Currently VMO in Zircon create using the zx_vmo_create is resizable
by default, but we'll be changing this in the future, requiring an
explicit flag to make the VMO resizable.

Prepare for this change by passing ZX_VMO_RESIZABLE option to all
zx_vmo_create calls that need resizable VMO.

Differential Revision: https://reviews.llvm.org/D61450

Modified:
    compiler-rt/trunk/lib/profile/InstrProfilingPlatformFuchsia.c
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_coverage_fuchsia.cc
    compiler-rt/trunk/lib/scudo/standalone/fuchsia.cc
    compiler-rt/trunk/lib/xray/xray_utils.cc

Modified: compiler-rt/trunk/lib/profile/InstrProfilingPlatformFuchsia.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfilingPlatformFuchsia.c?rev=359803&r1=359802&r2=359803&view=diff
==============================================================================
--- compiler-rt/trunk/lib/profile/InstrProfilingPlatformFuchsia.c (original)
+++ compiler-rt/trunk/lib/profile/InstrProfilingPlatformFuchsia.c Thu May  2 10:24:53 2019
@@ -70,7 +70,7 @@ static uint32_t lprofVMOWriter(ProfDataW
       return -1;
 
     /* Create VMO to hold the profile data. */
-    Status = _zx_vmo_create(0, 0, &__llvm_profile_vmo);
+    Status = _zx_vmo_create(0, ZX_VMO_RESIZABLE, &__llvm_profile_vmo);
     if (Status != ZX_OK)
       return -1;
 

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_coverage_fuchsia.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_coverage_fuchsia.cc?rev=359803&r1=359802&r2=359803&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_coverage_fuchsia.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_coverage_fuchsia.cc Thu May  2 10:24:53 2019
@@ -132,7 +132,7 @@ class TracePcGuardController final {
       // The first sample goes at [1] to reserve [0] for the magic number.
       next_index_ = 1 + num_guards;
 
-      zx_status_t status = _zx_vmo_create(DataSize(), 0, &vmo_);
+      zx_status_t status = _zx_vmo_create(DataSize(), ZX_VMO_RESIZABLE, &vmo_);
       CHECK_EQ(status, ZX_OK);
 
       // Give the VMO a name including our process KOID so it's easy to spot.

Modified: compiler-rt/trunk/lib/scudo/standalone/fuchsia.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/scudo/standalone/fuchsia.cc?rev=359803&r1=359802&r2=359803&view=diff
==============================================================================
--- compiler-rt/trunk/lib/scudo/standalone/fuchsia.cc (original)
+++ compiler-rt/trunk/lib/scudo/standalone/fuchsia.cc Thu May  2 10:24:53 2019
@@ -80,7 +80,7 @@ void *map(void *Addr, uptr Size, const c
     }
   } else {
     // Otherwise, create a Vmo and set its name.
-    Status = _zx_vmo_create(Size, 0, &Vmo);
+    Status = _zx_vmo_create(Size, ZX_VMO_RESIZABLE, &Vmo);
     if (Status != ZX_OK) {
       if (Status != ZX_ERR_NO_MEMORY || !AllowNoMem)
         dieOnMapUnmapError(Status == ZX_ERR_NO_MEMORY);

Modified: compiler-rt/trunk/lib/xray/xray_utils.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/xray/xray_utils.cc?rev=359803&r1=359802&r2=359803&view=diff
==============================================================================
--- compiler-rt/trunk/lib/xray/xray_utils.cc (original)
+++ compiler-rt/trunk/lib/xray/xray_utils.cc Thu May  2 10:24:53 2019
@@ -78,7 +78,7 @@ void LogWriter::Flush() XRAY_NEVER_INSTR
 LogWriter *LogWriter::Open() XRAY_NEVER_INSTRUMENT {
   // Create VMO to hold the profile data.
   zx_handle_t Vmo;
-  zx_status_t Status = _zx_vmo_create(0, 0, &Vmo);
+  zx_status_t Status = _zx_vmo_create(0, ZX_VMO_RESIZABLE, &Vmo);
   if (Status != ZX_OK) {
     Report("XRay: cannot create VMO: %s\n", _zx_status_get_string(Status));
     return nullptr;




More information about the llvm-commits mailing list