From ae51f304d28ca8ff3e0680448371c936f10490d0 Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Fri, 7 Jan 2022 00:07:14 +0900 Subject: 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 --- io_buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'io_buffer.c') 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); -- cgit v1.2.1