]> granicus.if.org Git - php/commitdiff
Remove unused HAVE_MEM_MMAP_ANON and HAVE_MEM_MMAP_ZERO checks
authorNikita Popov <nikita.ppv@gmail.com>
Mon, 17 Sep 2018 10:03:45 +0000 (12:03 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Mon, 17 Sep 2018 10:08:11 +0000 (12:08 +0200)
These haven't been used since the MM rewrite in PHP 7.0. Nowadays
we assume that either MAP_ANON or MAP_ANONYMOUS is available.

Zend/Zend.m4

index eb41cdc09e302c5e1103b9605b9837ebc393dcee..8b7971eea1ddeb6a9a171129806ab7c4cde28b97 100644 (file)
@@ -260,106 +260,6 @@ int main()
 
 AC_MSG_RESULT(done)
 
-dnl test for memory allocation using mmap(MAP_ANON)
-AC_MSG_CHECKING(for memory allocation using mmap(MAP_ANON))
-
-AC_RUN_IFELSE([AC_LANG_SOURCE([[
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <sys/mman.h>
-#include <stdlib.h>
-#include <stdio.h>
-#ifndef MAP_ANON
-# ifdef MAP_ANONYMOUS
-#  define MAP_ANON MAP_ANONYMOUS
-# endif
-#endif
-#ifndef MREMAP_MAYMOVE
-# define MREMAP_MAYMOVE 0
-#endif
-#ifndef MAP_FAILED
-# define MAP_FAILED ((void*)-1)
-#endif
-
-#define SEG_SIZE (256*1024)
-
-int main()
-{
-       void *seg = mmap(NULL, SEG_SIZE, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0);
-       if (seg == MAP_FAILED) {
-               return 1;
-       }
-       if (munmap(seg, SEG_SIZE) != 0) {
-               return 2;
-       }
-       return 0;
-}
-]])], [
-  AC_DEFINE([HAVE_MEM_MMAP_ANON], 1, [Define if the target system has support for memory allocation using mmap(MAP_ANON)])
-  AC_MSG_RESULT(yes)
-], [
-  AC_MSG_RESULT(no)
-], [
-  dnl cross-compile needs something here
-  AC_MSG_RESULT(no)
-])
-
-dnl test for memory allocation using mmap("/dev/zero")
-AC_MSG_CHECKING(for memory allocation using mmap("/dev/zero"))
-
-AC_RUN_IFELSE([AC_LANG_SOURCE([[
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <sys/mman.h>
-#include <stdlib.h>
-#include <stdio.h>
-#ifndef MAP_ANON
-# ifdef MAP_ANONYMOUS
-#  define MAP_ANON MAP_ANONYMOUS
-# endif
-#endif
-#ifndef MREMAP_MAYMOVE
-# define MREMAP_MAYMOVE 0
-#endif
-#ifndef MAP_FAILED
-# define MAP_FAILED ((void*)-1)
-#endif
-
-#define SEG_SIZE (256*1024)
-
-int main()
-{
-       int fd;
-       void *seg;
-
-       fd = open("/dev/zero", O_RDWR, S_IRUSR | S_IWUSR);
-       if (fd < 0) {
-               return 1;
-       }
-       seg = mmap(NULL, SEG_SIZE, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
-       if (seg == MAP_FAILED) {
-               return 2;
-       }
-       if (munmap(seg, SEG_SIZE) != 0) {
-               return 3;
-       }
-       if (close(fd) != 0) {
-               return 4;
-       }
-       return 0;
-}
-]])], [
-  AC_DEFINE([HAVE_MEM_MMAP_ZERO], 1, [Define if the target system has support for memory allocation using mmap("/dev/zero")])
-  AC_MSG_RESULT(yes)
-], [
-  AC_MSG_RESULT(no)
-], [
-  dnl cross-compile needs something here
-  AC_MSG_RESULT(no)
-])
-
 AC_CHECK_FUNCS(mremap)