FreeBSD Bugzilla – Attachment 186420 Details for
Bug 222356
www/firefox: file-backed shared memory performance
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
firefox patch
patch-shmem (text/plain), 2.13 KB, created by
Tijl Coosemans
on 2017-09-15 19:21:54 UTC
(
hide
)
Description:
firefox patch
Filename:
MIME Type:
Creator:
Tijl Coosemans
Created:
2017-09-15 19:21:54 UTC
Size:
2.13 KB
patch
obsolete
>--- ipc/chromium/src/base/shared_memory.h.orig 2017-06-15 22:51:57.000000000 +0200 >+++ ipc/chromium/src/base/shared_memory.h 2017-09-15 17:06:29.295528000 +0200 >@@ -114,7 +114,6 @@ > // are technically only unique to a single filesystem. However, we always > // allocate shared memory backing files from the same directory, so will end > // up on the same filesystem. >- SharedMemoryId id() const { return inode_; } > #endif > > // Closes the open shared memory segment. >@@ -174,7 +173,6 @@ > HANDLE mapped_file_; > #elif defined(OS_POSIX) > int mapped_file_; >- ino_t inode_; > #endif > void* memory_; > bool read_only_; >--- ipc/chromium/src/base/shared_memory_posix.cc.orig 2017-06-15 22:51:57.000000000 +0200 >+++ ipc/chromium/src/base/shared_memory_posix.cc 2017-09-15 17:08:41.443801000 +0200 >@@ -22,7 +22,6 @@ > > SharedMemory::SharedMemory() > : mapped_file_(-1), >- inode_(0), > memory_(NULL), > read_only_(false), > max_size_(0) { >@@ -41,7 +40,6 @@ > } > > mapped_file_ = handle.fd; >- inode_ = st.st_ino; > read_only_ = read_only; > return true; > } >@@ -155,13 +153,8 @@ > // It doesn't make sense to have a read-only private piece of shmem > DCHECK(posix_flags & (O_RDWR | O_WRONLY)); > >- FilePath path; >- fp = file_util::CreateAndOpenTemporaryShmemFile(&path); >- >- // Deleting the file prevents anyone else from mapping it in >- // (making it private), and prevents the need for cleanup (once >- // the last fd is closed, it is truly freed). >- file_util::Delete(path); >+ int fd = shm_open(SHM_ANON, posix_flags, 0600); >+ fp = fdopen(fd, "a+"); > } else { > std::wstring mem_filename; > if (FilenameForMemoryName(name, &mem_filename) == false) >@@ -214,7 +207,6 @@ > struct stat st; > if (fstat(mapped_file_, &st)) > NOTREACHED(); >- inode_ = st.st_ino; > > return true; > } >@@ -224,7 +216,7 @@ > return false; > > memory_ = mmap(NULL, bytes, PROT_READ | (read_only_ ? 0 : PROT_WRITE), >- MAP_SHARED, mapped_file_, 0); >+ MAP_SHARED | MAP_NOSYNC, mapped_file_, 0); > > if (memory_) > max_size_ = bytes;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 222356
:
186420
|
194794