From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ken Brown Newsgroups: gmane.emacs.bugs Subject: bug#15094: Fix for posix_memalign on Cygwin Date: Wed, 14 Aug 2013 12:22:18 -0400 Message-ID: <520BAEBA.1030306@cornell.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------030501050905070806050509" X-Trace: ger.gmane.org 1376497401 16821 80.91.229.3 (14 Aug 2013 16:23:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 14 Aug 2013 16:23:21 +0000 (UTC) To: 15094@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Aug 14 18:23:22 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1V9dqz-0004LP-TW for geb-bug-gnu-emacs@m.gmane.org; Wed, 14 Aug 2013 18:23:22 +0200 Original-Received: from localhost ([::1]:43523 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V9dqz-0000js-Gw for geb-bug-gnu-emacs@m.gmane.org; Wed, 14 Aug 2013 12:23:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36502) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V9dqo-0000a8-Sk for bug-gnu-emacs@gnu.org; Wed, 14 Aug 2013 12:23:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V9dqi-00047B-1L for bug-gnu-emacs@gnu.org; Wed, 14 Aug 2013 12:23:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35892) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V9dqh-000474-TR for bug-gnu-emacs@gnu.org; Wed, 14 Aug 2013 12:23:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1V9dqh-0006Dd-5l for bug-gnu-emacs@gnu.org; Wed, 14 Aug 2013 12:23:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ken Brown Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 Aug 2013 16:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 15094 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: emacs-bug Original-Received: via spool by submit@debbugs.gnu.org id=B.137649738023885 (code B ref -1); Wed, 14 Aug 2013 16:23:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 14 Aug 2013 16:23:00 +0000 Original-Received: from localhost ([127.0.0.1]:58441 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1V9dqd-0006DA-Ld for submit@debbugs.gnu.org; Wed, 14 Aug 2013 12:23:00 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:34704) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1V9dqa-0006Cv-L5 for submit@debbugs.gnu.org; Wed, 14 Aug 2013 12:22:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V9dqO-0003oC-4s for submit@debbugs.gnu.org; Wed, 14 Aug 2013 12:22:51 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:42725) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V9dqO-0003o8-2U for submit@debbugs.gnu.org; Wed, 14 Aug 2013 12:22:44 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36395) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V9dqH-0008R8-UI for bug-gnu-emacs@gnu.org; Wed, 14 Aug 2013 12:22:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V9dq7-0003lI-MZ for bug-gnu-emacs@gnu.org; Wed, 14 Aug 2013 12:22:37 -0400 Original-Received: from limerock03.mail.cornell.edu ([128.84.12.34]:50215) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V9dq7-0003jK-Ih for bug-gnu-emacs@gnu.org; Wed, 14 Aug 2013 12:22:27 -0400 X-CornellRouted: This message has been Routed already. Original-Received: from authusersmtp.mail.cornell.edu (granite3.serverfarm.cornell.edu [10.16.197.8]) by limerock03.mail.cornell.edu (8.14.4/8.14.4_cu) with ESMTP id r7EGMCAI023911 for ; Wed, 14 Aug 2013 12:22:12 -0400 Original-Received: from [192.168.1.4] (cpe-67-249-194-47.twcny.res.rr.com [67.249.194.47]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id r7EGMBbS007916 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Wed, 14 Aug 2013 12:22:12 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:77347 Archived-At: This is a multi-part message in MIME format. --------------030501050905070806050509 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cygwin allows applications to supply their own malloc but not, until today, their own posix_memalign. This has caused problems with the GTK build of Emacs on Cygwin. The problem became worse with the latest Glib update. Anyone who wants the gory details can find them starting here: http://cygwin.com/ml/cygwin-xfree/2013-08/msg00018.html Cygwin was just patched today to allow applications to supply their own posix_memalign (but not their own memalign), which solves the Glib problem. But posix_memalign in gmalloc.c calls memalign, so I need to make sure that it calls Emacs's memalign. The attached patch does this. Is this a reasonable way to handle the problem? (I plan to also add an explanatory comment.) Thanks. Ken --------------030501050905070806050509 Content-Type: text/plain; charset=windows-1252; name="memalign.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="memalign.patch" === modified file 'src/gmalloc.c' --- src/gmalloc.c 2013-01-02 16:13:04 +0000 +++ src/gmalloc.c 2013-08-14 16:01:02 +0000 @@ -1558,8 +1558,14 @@ void *(*__memalign_hook) (size_t size, size_t alignment); +#ifdef CYGWIN +#define memalign memalign1 +void * +memalign1 (size_t alignment, size_t size) +#else void * memalign (size_t alignment, size_t size) +#endif { void *result; size_t adj, lastadj; --------------030501050905070806050509--