1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Mark non-private mapped files as external.

This commit is contained in:
Samuel Williams 2021-12-20 12:37:05 +13:00
parent da46b8d8e5
commit c86bcd434d
Notes: git 2021-12-21 08:26:08 +09:00
3 changed files with 23 additions and 20 deletions

View file

@ -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 {