Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(418)

Unified Diff: runtime/vm/virtual_memory_fuchsia.cc

Issue 2929203002: [Fuchsia] Give VMOs names (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/virtual_memory_android.cc ('k') | runtime/vm/virtual_memory_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/virtual_memory_fuchsia.cc
diff --git a/runtime/vm/virtual_memory_fuchsia.cc b/runtime/vm/virtual_memory_fuchsia.cc
index bc708ec8516e588d9ba1a2f2380ef65e93505c82..a364e2806342499865f42716b1154dac5d5fceb5 100644
--- a/runtime/vm/virtual_memory_fuchsia.cc
+++ b/runtime/vm/virtual_memory_fuchsia.cc
@@ -201,7 +201,10 @@ bool VirtualMemory::FreeSubSegment(int32_t handle,
}
-bool VirtualMemory::Commit(uword addr, intptr_t size, bool executable) {
+bool VirtualMemory::Commit(uword addr,
+ intptr_t size,
+ bool executable,
+ const char* name) {
ASSERT(Contains(addr));
ASSERT(Contains(addr + size) || (addr + size == end()));
mx_handle_t vmo = MX_HANDLE_INVALID;
@@ -212,6 +215,15 @@ bool VirtualMemory::Commit(uword addr, intptr_t size, bool executable) {
return false;
}
+ if (name != NULL) {
+ status = mx_object_set_property(vmo, MX_PROP_NAME, name, strlen(name));
+ if (status != NO_ERROR) {
abarth 2017/06/09 19:46:40 The pattern we've been using is to ignore errors o
zra 2017/06/09 20:10:22 Done.
+ mx_handle_close(vmo);
+ LOG_ERR("mx_object_set_property on vmo failed: %s\n",
+ mx_status_get_string(status));
+ }
+ }
+
mx_handle_t vmar = static_cast<mx_handle_t>(handle());
const size_t offset = addr - start();
const uint32_t flags = MX_VM_FLAG_SPECIFIC | MX_VM_FLAG_PERM_READ |
« no previous file with comments | « runtime/vm/virtual_memory_android.cc ('k') | runtime/vm/virtual_memory_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698