diff options
author | Samuel Williams <samuel.williams@oriontransfer.co.nz> | 2021-12-20 12:37:05 +1300 |
---|---|---|
committer | Samuel Williams <samuel.williams@oriontransfer.co.nz> | 2021-12-21 12:25:42 +1300 |
commit | c86bcd434da573982ab52522a301ba5499dc13ed (patch) | |
tree | 0cce48291f77a8c7325128dfced1198addc198fe /include/ruby | |
parent | da46b8d8e5d09f896fb1af5dabea12820f02b3d6 (diff) | |
download | ruby-c86bcd434da573982ab52522a301ba5499dc13ed.tar.gz |
Mark non-private mapped files as external.
Diffstat (limited to 'include/ruby')
-rw-r--r-- | include/ruby/io/buffer.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/include/ruby/io/buffer.h b/include/ruby/io/buffer.h index 0ee0a005e8..d5f646cd49 100644 --- a/include/ruby/io/buffer.h +++ b/include/ruby/io/buffer.h @@ -27,20 +27,24 @@ RUBY_EXTERN size_t RUBY_IO_BUFFER_DEFAULT_SIZE; enum rb_io_buffer_flags { // The memory in the buffer is owned by someone else. - RB_IO_BUFFER_EXTERNAL = 0, + // More specifically, it means that someone else owns the buffer and we shouldn't try to resize it. + RB_IO_BUFFER_EXTERNAL = 1, // The memory in the buffer is allocated internally. - RB_IO_BUFFER_INTERNAL = 1, + RB_IO_BUFFER_INTERNAL = 2, // The memory in the buffer is mapped. - RB_IO_BUFFER_MAPPED = 2, + // A non-private mapping is marked as external. + RB_IO_BUFFER_MAPPED = 4, // The buffer is locked and cannot be resized. - RB_IO_BUFFER_LOCKED = 16, + // More specifically, it means we can't change the base address or size. + // A buffer is typically locked before a system call that uses the data. + RB_IO_BUFFER_LOCKED = 32, // The buffer mapping is private and will not impact other processes or the underlying file. - RB_IO_BUFFER_PRIVATE = 32, + RB_IO_BUFFER_PRIVATE = 64, // The buffer is read-only and cannot be modified. - RB_IO_BUFFER_IMMUTABLE = 64 + RB_IO_BUFFER_IMMUTABLE = 128 }; enum rb_io_buffer_endian { |