summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog7
-rw-r--r--src/emacs.c5
-rw-r--r--src/s/cygwin.h6
3 files changed, 18 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 602742806c5..e6165d3c13e 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
+2009-12-09 Ken Brown <kbrown@cornell.edu> (tiny change)
+
+ * s/cygwin.h (G_SLICE_ALWAYS_MALLOC): New variable.
+
+ * emacs.c (main): Set the G_SLICE environment variable for Cygwin
+ GTK builds.
+
2009-12-07 Andreas Schwab <schwab@linux-m68k.org>
* unexelf.c (unexec): Don't search for .data twice.
diff --git a/src/emacs.c b/src/emacs.c
index d96b3a1daf1..8b88985969b 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -809,6 +809,11 @@ main (int argc, char **argv)
stack_base = &dummy;
#endif
+#if defined (USE_GTK) && defined (G_SLICE_ALWAYS_MALLOC)
+ /* This is used by the Cygwin build. */
+ setenv ("G_SLICE", "always-malloc", 1);
+#endif
+
if (!initialized)
{
extern char my_endbss[];
diff --git a/src/s/cygwin.h b/src/s/cygwin.h
index 69b826ac932..3dd73c0f6e1 100644
--- a/src/s/cygwin.h
+++ b/src/s/cygwin.h
@@ -126,6 +126,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Virtual addresses of pure and impure space can vary, as on Windows. */
#define VIRT_ADDR_VARIES
+/* 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
+
/* the end */
/* arch-tag: 5ae7ba00-83b0-4ab3-806a-3e845779191b