Bug 1479960 - Remove SHM_ANON support. r=froydnj

FreeBSD's SHM_ANON is useful for the usual case of shared memory, but it
doesn't support freezing.  It could be re-added later, but for now it's
simplest to remove it (and use named shm instead) while refactoring.

Depends on D26738

Differential Revision: https://phabricator.services.mozilla.com/D26739

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jed Davis 2019-06-20 22:40:17 +00:00
Родитель d32b9ba525
Коммит b916fc745c
1 изменённых файлов: 2 добавлений и 6 удалений

Просмотреть файл

@ -61,7 +61,7 @@ SharedMemoryHandle SharedMemory::NULLHandle() { return SharedMemoryHandle(); }
// static
bool SharedMemory::AppendPosixShmPrefix(std::string* str, pid_t pid) {
#if defined(ANDROID) || defined(SHM_ANON)
#if defined(ANDROID)
return false;
#else
*str += '/';
@ -87,7 +87,7 @@ bool SharedMemory::AppendPosixShmPrefix(std::string* str, pid_t pid) {
// enough for this.
StringAppendF(str, "org.mozilla.ipc.%d.", static_cast<int>(pid));
return true;
#endif // !ANDROID && !SHM_ANON
#endif // !ANDROID
}
bool SharedMemory::Create(size_t size) {
@ -112,10 +112,6 @@ bool SharedMemory::Create(size_t size) {
return false;
}
needs_truncate = false;
#elif defined(SHM_ANON)
// FreeBSD (or any other Unix that might decide to implement this
// nice, simple API):
fd = shm_open(SHM_ANON, O_RDWR, 0600);
#else
// Generic Unix: shm_open + shm_unlink
do {