mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
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.
This commit is contained in:
parent
640bacceb1
commit
8ae7c22972
Notes:
git
2024-11-21 18:48:28 +00:00
10 changed files with 100 additions and 5 deletions
|
@ -16,6 +16,7 @@
|
|||
#include "internal/array.h"
|
||||
#include "internal/bits.h"
|
||||
#include "internal/error.h"
|
||||
#include "internal/gc.h"
|
||||
#include "internal/numeric.h"
|
||||
#include "internal/string.h"
|
||||
#include "internal/io.h"
|
||||
|
@ -83,6 +84,8 @@ io_buffer_map_memory(size_t size, int flags)
|
|||
if (base == MAP_FAILED) {
|
||||
rb_sys_fail("io_buffer_map_memory:mmap");
|
||||
}
|
||||
|
||||
ruby_annotate_mmap(base, size, "Ruby:io_buffer_map_memory");
|
||||
#endif
|
||||
|
||||
return base;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue