diff options
| author | Paul Eggert | 2013-11-06 21:31:04 -0800 |
|---|---|---|
| committer | Paul Eggert | 2013-11-06 21:31:04 -0800 |
| commit | aea07e2c6e54733804d0be54e97d44fcb3df63dd (patch) | |
| tree | 1f84e37d28aa136603322428a81c2f0046bf9844 /src/conf_post.h | |
| parent | e6e4db3cac4630fc83e4bc520f99823572c3e592 (diff) | |
| download | emacs-aea07e2c6e54733804d0be54e97d44fcb3df63dd.tar.gz emacs-aea07e2c6e54733804d0be54e97d44fcb3df63dd.zip | |
Port to C11 aligned_alloc, and fix some integer overflows.
* configure.ac (GMALLOC_OBJ): Initialize to empty if !system_malloc
and doug_lea_malloc.
(aligned_alloc): Test for existence if !GMALLOC_OBJ and not darwin.
(posix_memalign): Test for existence only if !GMALLOC_OBJ and
not darwin and !aligned_alloc.
* src/alloc.c (USE_ALIGNED_ALLOC): New symbol.
(USE_POSIX_MEMALIGN): Remove. All uses replaced with USE_ALIGNED_ALLOC,
and use of posix_memalign replaced with aligned_alloc.
(aligned_alloc): New function, defined or declared as needed.
* src/conf_post.h (HAVE_POSIX_MEMALIGN) [DARWIN_OS]:
Don't undef; configure.ac now does this.
* src/gmalloc.c (aligned_alloc) [MSDOS]: New decl.
(calloc, aligned_alloc): Check for integer overflow.
(aligned_alloc): Rename from memalign. All uses changed.
(memalign): New function, an alias for aligned_alloc.
Diffstat (limited to 'src/conf_post.h')
| -rw-r--r-- | src/conf_post.h | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/src/conf_post.h b/src/conf_post.h index 786105864f2..2d967c0fefc 100644 --- a/src/conf_post.h +++ b/src/conf_post.h | |||
| @@ -49,8 +49,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 49 | #define malloc unexec_malloc | 49 | #define malloc unexec_malloc |
| 50 | #define realloc unexec_realloc | 50 | #define realloc unexec_realloc |
| 51 | #define free unexec_free | 51 | #define free unexec_free |
| 52 | /* Don't use posix_memalign because it is not compatible with unexmacosx.c. */ | ||
| 53 | #undef HAVE_POSIX_MEMALIGN | ||
| 54 | #endif | 52 | #endif |
| 55 | /* The following solves the problem that Emacs hangs when evaluating | 53 | /* The following solves the problem that Emacs hangs when evaluating |
| 56 | (make-comint "test0" "/nodir/nofile" nil "") when /nodir/nofile | 54 | (make-comint "test0" "/nodir/nofile" nil "") when /nodir/nofile |