emacs-devel
[Top][All Lists]
Advanced

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

Re: Fix for Cygwin/GSlice problem


From: Stefan Monnier
Subject: Re: Fix for Cygwin/GSlice problem
Date: Wed, 09 Dec 2009 09:31:20 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

>>>> +/* 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




reply via email to

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