From 4f1adeaec4ce0e9c78d81a8e75804a05180f6220 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Tue, 3 Dec 2019 12:40:06 +1100 Subject: [PATCH] Attempt to allocate buffer when it is larger than maxram instead of aborting without even trying. --- stream.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stream.c b/stream.c index b5c454a..407c550 100644 --- a/stream.c +++ b/stream.c @@ -1656,11 +1656,11 @@ fill_another: fsync(control->fd_out); if (unlikely(u_len > control->maxram)) - fatal_return(("Unable to malloc buffer of size %lld in this environment\n", u_len), -1); + print_progress("Warning, attempting to malloc very large buffer for this environment of size %lld\n", u_len); max_len = MAX(u_len, MIN_SIZE); max_len = MAX(max_len, c_len); s_buf = malloc(max_len); - if (unlikely(u_len && !s_buf)) + if (unlikely(!s_buf)) fatal_return(("Unable to malloc buffer of size %lld in fill_buffer\n", u_len), -1); sinfo->ram_alloced += u_len;