Date: Thu, 25 Aug 2016 19:17:16 +0000 (UTC) From: Garrett Cooper <ngie@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r304813 - projects/netbsd-tests-update-12/contrib/netbsd-tests/lib/libc/stdlib Message-ID: <201608251917.u7PJHGG5015510@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ngie Date: Thu Aug 25 19:17:16 2016 New Revision: 304813 URL: https://svnweb.freebsd.org/changeset/base/304813 Log: Don't test `size[i] % align[i] == 0` case on FreeBSD Per jemalloc(3)/aligned_alloc(3), the behavior is undefined if the size isn't an integral multiple of the alignment. Thus, this is a NetBSD-specific test. Sponsored by: EMC / Isilon Storage Division Modified: projects/netbsd-tests-update-12/contrib/netbsd-tests/lib/libc/stdlib/t_posix_memalign.c Modified: projects/netbsd-tests-update-12/contrib/netbsd-tests/lib/libc/stdlib/t_posix_memalign.c ============================================================================== --- projects/netbsd-tests-update-12/contrib/netbsd-tests/lib/libc/stdlib/t_posix_memalign.c Thu Aug 25 19:15:02 2016 (r304812) +++ projects/netbsd-tests-update-12/contrib/netbsd-tests/lib/libc/stdlib/t_posix_memalign.c Thu Aug 25 19:17:16 2016 (r304813) @@ -121,9 +121,19 @@ ATF_TC_BODY(aligned_alloc_basic, tc) ATF_REQUIRE_EQ_MSG((align[i] - 1) & align[i], 0, "aligned_alloc: success when alignment was not " "a power of 2"); +#ifdef __NetBSD__ + /* + * NetBSD-specific invariant + * + * From aligned_alloc(3) on FreeBSD: + * + * Behavior is undefined if size is not an integral + * multiple of alignment. + */ ATF_REQUIRE_EQ_MSG(size[i] % align[i], 0, "aligned_alloc: success when size was not an " "integer multiple of alignment"); +#endif ATF_REQUIRE_EQ_MSG(((intptr_t)p) & (align[i] - 1), 0, "p = %p", p); free(p);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608251917.u7PJHGG5015510>