summaryrefslogtreecommitdiff
path: root/io_buffer.c
diff options
context:
space:
mode:
authorYuta Saito <kateinoigakukun@gmail.com>2022-01-07 00:07:14 +0900
committerYusuke Endoh <mame@ruby-lang.org>2022-01-07 02:13:19 +0900
commitae51f304d28ca8ff3e0680448371c936f10490d0 (patch)
treefe6fb6099d0e49578c184e1954063e91a1f50152 /io_buffer.c
parent5ad507d751e63ed53f8eb0e518f72aca6588be62 (diff)
downloadruby-ae51f304d28ca8ff3e0680448371c936f10490d0.tar.gz
io_buffer.c: use mremap based resizing only when mremap available
some libc implementations (e.g. wasi-libc) define MREMAP_MAYMOVE, but don't have mremap itself, so guard the use of mremap by HAVE_MREMAP
Diffstat (limited to 'io_buffer.c')
-rw-r--r--io_buffer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/io_buffer.c b/io_buffer.c
index 71136d4eb6..fb18e729a6 100644
--- a/io_buffer.c
+++ b/io_buffer.c
@@ -1239,7 +1239,7 @@ rb_io_buffer_resize(VALUE self, size_t size)
rb_raise(rb_eIOBufferAccessError, "Cannot resize external buffer!");
}
-#ifdef MREMAP_MAYMOVE
+#if defined(HAVE_MREMAP) && defined(MREMAP_MAYMOVE)
if (data->flags & RB_IO_BUFFER_MAPPED) {
void *base = mremap(data->base, data->size, size, MREMAP_MAYMOVE);