[Linux] Use memfd_create when available in SharedMemory implementation
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Nov 2018 14:24:09 +0000 (14:24 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Nov 2018 14:24:09 +0000 (14:24 +0000)
commit0587aeb3485779851323674ce889f3e7f7325030
treebbf947d72a7681d9ba0894df1f3b2ce620a7dd68
parentd1515b1bd2b4a368dcf98e6032d342a3784972a1
[Linux] Use memfd_create when available in SharedMemory implementation
https://bugs.webkit.org/show_bug.cgi?id=189741

Reviewed by Michael Catanzaro.

.:

Add include check for linux/memfd.h header.

* Source/cmake/OptionsCommon.cmake:

Source/WebKit:

If memfd is available, use it instead of shm_open.

* Platform/unix/SharedMemoryUnix.cpp:
(WebKit::createSharedMemory): Helper to create the shared memory, trying first with memfd and falling back to
shm if it's not available.
(WebKit::SharedMemory::create): Use createSharedMemory() helper.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237922 268f45cc-cd09-0410-ab3c-d52691b4dbfc
ChangeLog
Source/WebKit/ChangeLog
Source/WebKit/Platform/unix/SharedMemoryUnix.cpp
Source/cmake/OptionsCommon.cmake