diff options
Diffstat (limited to 'src/shm.c')
-rw-r--r-- | src/shm.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -34,7 +34,19 @@ static int create_shm_file(void) int shm_allocate_file(size_t size) { +#ifdef __linux__ + /* + * On linux, we can just use memfd_create(). This is both simpler and + * potentially allows usage of Transparent HugePages, which speed up + * the first paint of a large screen buffer. + * + * This isn't available on *BSD, which we could conceivably be running + * on. + */ + int fd = memfd_create("wl_shm", 0); +#else int fd = create_shm_file(); +#endif if (fd < 0) return -1; int ret; |