bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

memalign: Work around Solaris bug


From: Bruno Haible
Subject: memalign: Work around Solaris bug
Date: Thu, 31 Dec 2020 22:21:34 +0100
User-agent: KMail/5.1.3 (Linux/4.4.0-197-generic; KDE/5.18.0; x86_64; ; )

On Solaris 11.4, Solaris OpenIndiana, Solaris OmniOS, I see this test failure:

../../gltests/test-memalign.c:51: assertion 'aligned2_blocks[i] != NULL' failed
FAIL test-memalign (exit status: 262)

Apparently memalign() does not support alignments 1 and 2 on this platform.

This patch fixes it, by using malloc() in these cases. (Bumping the alignment
to 4 in these cases would be an alternative workaround.)


2020-12-31  Bruno Haible  <bruno@clisp.org>

        memalign: Work around Solaris bug.
        * lib/memalign.c: New file.
        * m4/memalign.m4: New file.
        * modules/memalign (Files): Add them.
        (Depends-on): Add malloc-h.
        (configure.ac): Invoke gl_FUNC_MEMALIGN. Conditionally compile
        memalign.c. Set module indicator.
        (Include): Include <malloc.h> unconditionally.
        * doc/glibc-functions/memalign.texi: Mention the Solaris issues.

        malloc-h: Add tests.
        * tests/test-malloc-h.c: New file.
        * modules/malloc-h-tests: New file.
        * tests/test-malloc-h-c++.cc: New file.
        * modules/malloc-h-c++-tests: New file.

        malloc-h: New module.
        * lib/malloc.in.h: New file.
        * m4/malloc_h.m4: New file.
        * modules/malloc-h: New file.
        * doc/glibc-headers/malloc.texi: New file.
        * doc/gnulib.texi (Glibc Header File Substitutes): Include it.

Attachment: 0001-malloc-h-New-module.patch
Description: Text Data

Attachment: 0002-malloc-h-Add-tests.patch
Description: Text Data

Attachment: 0003-memalign-Work-around-Solaris-bug.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]