From owner-svn-src-head@freebsd.org Wed Dec 30 03:36:23 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8EA4A55B14; Wed, 30 Dec 2015 03:36:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B4EE173F; Wed, 30 Dec 2015 03:36:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBU3aMZN000640; Wed, 30 Dec 2015 03:36:22 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBU3aMQT000639; Wed, 30 Dec 2015 03:36:22 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201512300336.tBU3aMQT000639@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 30 Dec 2015 03:36:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292902 - head/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Dec 2015 03:36:23 -0000 Author: imp Date: Wed Dec 30 03:36:22 2015 New Revision: 292902 URL: https://svnweb.freebsd.org/changeset/base/292902 Log: Use __alignof__ instead of assuming int64_t to get the right alignment. Differential Revision: https://reviews.freebsd.org/D4708 Modified: head/lib/libc/stdio/findfp.c Modified: head/lib/libc/stdio/findfp.c ============================================================================== --- head/lib/libc/stdio/findfp.c Wed Dec 30 02:26:04 2015 (r292901) +++ head/lib/libc/stdio/findfp.c Wed Dec 30 03:36:22 2015 (r292902) @@ -99,16 +99,7 @@ moreglue(int n) FILE *p; size_t align; - /* - * FILE has a mbstate_t variable. This variable tries to be int64_t - * aligned through its definition. int64_t may be larger than void *, - * which is the size traditionally used for ALIGNBYTES. So, use our own - * rounding instead of the MI ALIGN macros. If for some reason - * ALIGNBYTES is larger than int64_t, respect that too. There appears to - * be no portable way to ask for FILE's alignment requirements other - * than just knowing here. - */ - align = MAX(ALIGNBYTES, sizeof(int64_t)); + align = __alignof__(FILE); g = (struct glue *)malloc(sizeof(*g) + align + n * sizeof(FILE)); if (g == NULL) return (NULL);