зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1164027
- Use MAP_ANONYMOUS instead of opening /dev/zero. r=jrmuizel
MozReview-Commit-ID: 5GeNG5Tm1GS --HG-- extra : histedit_source : 31e30d68fce2f97015c6e84da953e1b6f04fca50
This commit is contained in:
Родитель
eab2098c99
Коммит
4c00494425
|
@ -12,7 +12,6 @@
|
|||
#include <ctype.h>
|
||||
#include <vector>
|
||||
#ifdef MOZ_WIDGET_ANDROID
|
||||
#include <fcntl.h>
|
||||
#include <sys/mman.h>
|
||||
#endif
|
||||
|
||||
|
@ -2886,16 +2885,12 @@ WillTextureMapSucceed(GLsizei width, GLsizei height, GLenum format, GLenum type)
|
|||
// there to be double the actual size of the texture available.
|
||||
size_t size = width * height * GetBytesPerTexel(format, type) * 2;
|
||||
|
||||
int fd = open("/dev/zero", O_RDONLY);
|
||||
|
||||
void *p = mmap(nullptr, size, PROT_NONE, MAP_SHARED, fd, 0);
|
||||
void *p = mmap(nullptr, size, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
|
||||
if (p != MAP_FAILED) {
|
||||
willSucceed = true;
|
||||
munmap(p, size);
|
||||
}
|
||||
|
||||
close(fd);
|
||||
|
||||
return willSucceed;
|
||||
}
|
||||
#endif // MOZ_WIDGET_ANDROID
|
||||
|
|
Загрузка…
Ссылка в новой задаче