diff options
author | Kunshan Wang <[email protected]> | 2024-11-19 16:07:22 +0800 |
---|---|---|
committer | Peter Zhu <[email protected]> | 2024-11-21 13:48:05 -0500 |
commit | 8ae7c22972d82b14d7308e16c26389fa4412727f (patch) | |
tree | eed80cbe686cd9fd206c244785cdb4fa2247fc10 /yjit.c | |
parent | 640bacceb19f3ba2b60789a01511e5e280f8b4ce (diff) |
Annotate anonymous mmap
Use PR_SET_VMA_ANON_NAME to set human-readable names for anonymous
virtual memory areas mapped by `mmap()` when compiled and run on Linux
5.17 or higher. This makes it convenient for developers to debug mmap.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/12119
Diffstat (limited to 'yjit.c')
-rw-r--r-- | yjit.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -291,6 +291,7 @@ rb_yjit_reserve_addr_space(uint32_t mem_size) // If we succeeded, stop if (mem_block != MAP_FAILED) { + ruby_annotate_mmap(mem_block, mem_size, "Ruby:rb_yjit_reserve_addr_space"); break; } @@ -325,6 +326,10 @@ rb_yjit_reserve_addr_space(uint32_t mem_size) -1, 0 ); + + if (mem_block != MAP_FAILED) { + ruby_annotate_mmap(mem_block, mem_size, "Ruby:rb_yjit_reserve_addr_space:fallback"); + } } // Check that the memory mapping was successful |