From: Rosen Penev <rosenp@gmail.com>
To: linux-xfs@vger.kernel.org
Subject: [PATCH] db/malloc: Use posix_memalign instead of deprecated valloc
Date: Mon, 6 May 2019 14:03:26 -0700 [thread overview]
Message-ID: <20190506210326.29581-1-rosenp@gmail.com> (raw)
valloc is not available with uClibc-ng as well as being deprecated, which
causes compilation errors. aligned_alloc is not available before C11 so
used posix_memalign.'
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
db/malloc.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/db/malloc.c b/db/malloc.c
index 77b3e022..38fe0b05 100644
--- a/db/malloc.c
+++ b/db/malloc.c
@@ -44,8 +44,7 @@ xmalloc(
{
void *ptr;
- ptr = valloc(size);
- if (ptr)
+ if(!posix_memalign(&ptr, sysconf(_SC_PAGESIZE), size))
return ptr;
badmalloc();
/* NOTREACHED */
--
2.17.1
next reply other threads:[~2019-05-06 21:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-06 21:03 Rosen Penev [this message]
2019-05-06 22:20 ` [PATCH] db/malloc: Use posix_memalign instead of deprecated valloc Eric Sandeen
2019-05-06 22:51 ` Dave Chinner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190506210326.29581-1-rosenp@gmail.com \
--to=rosenp@gmail.com \
--cc=linux-xfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox