From: Ken Brown <kbrown@cornell.edu>
To: 15094@debbugs.gnu.org
Subject: bug#15094: Fix for posix_memalign on Cygwin
Date: Wed, 14 Aug 2013 12:22:18 -0400 [thread overview]
Message-ID: <520BAEBA.1030306@cornell.edu> (raw)
[-- Attachment #1: Type: text/plain, Size: 748 bytes --]
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
[-- Attachment #2: memalign.patch --]
[-- Type: text/plain, Size: 412 bytes --]
=== 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;
next reply other threads:[~2013-08-14 16:22 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-14 16:22 Ken Brown [this message]
2013-08-14 19:11 ` bug#15094: Fix for posix_memalign on Cygwin Ken Brown
2013-08-14 19:29 ` Eli Zaretskii
2013-08-14 19:52 ` Ken Brown
2013-08-15 2:46 ` Eli Zaretskii
2013-08-15 11:51 ` Ken Brown
2013-08-15 13:00 ` Ken Brown
2013-08-15 16:15 ` Ken Brown
2013-08-15 16:39 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=520BAEBA.1030306@cornell.edu \
--to=kbrown@cornell.edu \
--cc=15094@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.