Skip to content

Commit

Permalink
[compiler-rt] Set the ZX_VMO_RESIZABLE option for zx_vmo_create
Browse files Browse the repository at this point in the history
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

llvm-svn: 359803
  • Loading branch information
petrhosek committed May 2, 2019
1 parent 3d1d3ad commit 156226b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion compiler-rt/lib/profile/InstrProfilingPlatformFuchsia.c
Expand Up @@ -70,7 +70,7 @@ static uint32_t lprofVMOWriter(ProfDataWriter *This, ProfDataIOVec *IOVecs,
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;

Expand Down
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/lib/scudo/standalone/fuchsia.cc
Expand Up @@ -80,7 +80,7 @@ void *map(void *Addr, uptr Size, const char *Name, uptr Flags,
}
} 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);
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/lib/xray/xray_utils.cc
Expand Up @@ -78,7 +78,7 @@ void LogWriter::Flush() XRAY_NEVER_INSTRUMENT {
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;
Expand Down

0 comments on commit 156226b

Please sign in to comment.