forked from Floorp-Projects/Floorp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug 1172632 - Move some allocator related configure checks in a commo…
…n location for both top-level and js/src to use. r=mshal
- Loading branch information
Showing
5 changed files
with
58 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
dnl This Source Code Form is subject to the terms of the Mozilla Public | ||
dnl License, v. 2.0. If a copy of the MPL was not distributed with this | ||
dnl file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
dnl Check for the existence of various allocation headers/functions | ||
AC_DEFUN([MOZ_CHECK_ALLOCATOR],[ | ||
MALLOC_HEADERS="malloc.h malloc_np.h malloc/malloc.h sys/malloc.h" | ||
MALLOC_H= | ||
for file in $MALLOC_HEADERS; do | ||
MOZ_CHECK_HEADER($file, [MALLOC_H=$file]) | ||
if test "$MALLOC_H" != ""; then | ||
AC_DEFINE_UNQUOTED(MALLOC_H, <$MALLOC_H>) | ||
break | ||
fi | ||
done | ||
MOZ_CHECK_HEADERS(alloca.h) | ||
AC_CHECK_FUNCS(strndup posix_memalign memalign) | ||
AC_CHECK_FUNCS(malloc_usable_size) | ||
MALLOC_USABLE_SIZE_CONST_PTR=const | ||
MOZ_CHECK_HEADERS([malloc.h], [ | ||
AC_MSG_CHECKING([whether malloc_usable_size definition can use const argument]) | ||
AC_TRY_COMPILE([#include <malloc.h> | ||
#include <stddef.h> | ||
size_t malloc_usable_size(const void *ptr);], | ||
[return malloc_usable_size(0);], | ||
AC_MSG_RESULT([yes]), | ||
AC_MSG_RESULT([no]) | ||
MALLOC_USABLE_SIZE_CONST_PTR=) | ||
]) | ||
AC_DEFINE_UNQUOTED([MALLOC_USABLE_SIZE_CONST_PTR],[$MALLOC_USABLE_SIZE_CONST_PTR]) | ||
dnl In newer bionic headers, valloc is built but not defined, | ||
dnl so we check more carefully here. | ||
AC_MSG_CHECKING([for valloc in malloc.h]) | ||
AC_EGREP_HEADER(valloc, malloc.h, | ||
AC_DEFINE(HAVE_VALLOC) | ||
AC_MSG_RESULT([yes]), | ||
AC_MSG_RESULT([no])) | ||
AC_MSG_CHECKING([for valloc in unistd.h]) | ||
AC_EGREP_HEADER(valloc, unistd.h, | ||
AC_DEFINE(HAVE_VALLOC) | ||
AC_MSG_RESULT([yes]), | ||
AC_MSG_RESULT([no])) | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters