From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Fix for Cygwin/GSlice problem Date: Wed, 09 Dec 2009 09:31:20 -0500 Message-ID: References: <4B1EA7F6.3090504@cornell.edu> <4B1F1424.9020105@cornell.edu> <4B1F5A63.3030509@swipnet.se> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1260369102 19910 80.91.229.12 (9 Dec 2009 14:31:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 9 Dec 2009 14:31:42 +0000 (UTC) Cc: Ken Brown , emacs-devel@gnu.org To: "Jan D." Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 09 15:31:35 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NINZk-0001aC-16 for ged-emacs-devel@m.gmane.org; Wed, 09 Dec 2009 15:31:32 +0100 Original-Received: from localhost ([127.0.0.1]:46287 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NINZj-0006om-RP for ged-emacs-devel@m.gmane.org; Wed, 09 Dec 2009 09:31:31 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NINZf-0006oU-Dt for emacs-devel@gnu.org; Wed, 09 Dec 2009 09:31:27 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NINZa-0006nx-41 for emacs-devel@gnu.org; Wed, 09 Dec 2009 09:31:26 -0500 Original-Received: from [199.232.76.173] (port=59506 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NINZa-0006nu-1Y for emacs-devel@gnu.org; Wed, 09 Dec 2009 09:31:22 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:25239 helo=ironport2-out.pppoe.ca) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NINZZ-0007qG-Lj for emacs-devel@gnu.org; Wed, 09 Dec 2009 09:31:21 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtkEADdDH0vO+INN/2dsb2JhbACBTNYBhCwEihs X-IronPort-AV: E=Sophos;i="4.47,368,1257138000"; d="scan'208";a="51095669" Original-Received: from 206-248-131-77.dsl.teksavvy.com (HELO pastel.home) ([206.248.131.77]) by ironport2-out.pppoe.ca with ESMTP; 09 Dec 2009 09:31:21 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id E7EE98065; Wed, 9 Dec 2009 09:31:20 -0500 (EST) In-Reply-To: <4B1F5A63.3030509@swipnet.se> (Jan D.'s message of "Wed, 09 Dec 2009 09:05:55 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:118453 Archived-At: >>>> +/* Emacs supplies its own malloc, but glib (part of Gtk+) calls >>>> + memalign and on Cygwin, that becomes the Cygwin supplied memalign. >>>> + As malloc is not the Cygwin malloc, the Cygwin memalign always >>>> + returns ENOSYS. A workaround is to set G_SLICE=always-malloc. */ >>>> +#define G_SLICE_ALWAYS_MALLOC >>> Why does Cygwin-Emacs use its own malloc rather than the system malloc? > Emacs prefers its own malloc when the system malloc doesn't have the > required hooks. If this is critical or not I don't know. I'd suggest we try to use Cygwin's system malloc, with a clear comment about why we don't use our own, and what kind of workaround could be used (the G_SLICE_ALWAYS_MALLOC) if we wanted to use our own. FWIW, the malloc hooks such as __malloc_hook are only used when building without SYNC_INPUT, so now that we use SNYC_INPUT by default, it's not as important to use our own malloc any more. > I think it stopped because it came down to the way Cygwin handles > linking of malloc and friends. I don't understand why Cygwin doesn't > allow an application to have its own memalign, but do allow it to have > its own malloc. Maybe that's a bug in Cygwin's malloc. Stefan