In bug 230329 ; we added the possibility to wrap a SharedMemory into a SharedBuffer with the method SharedMemory::createSharedBuffer() : it avoid having to allocate memory and perform a new copy. It also helps in decreasing the amount of memory allocated in the GPU Process (limited to 200MB) as the memory is counted by jetsam as being linked to the content process. So rather than doing: ``` auto buffer = SharedBuffer::create(static_cast<unsigned char*>(sharedMemoryBuffer->data()), bufferSize); ``` which will copy the SharedMemory into a vector inside the SharedBuffer we can do: ``` auto buffer = sharedMemoryBuffer->createSharedBuffer(bufferSize); ``` and kill two birds with one store.
<rdar://problem/85637721>
Created attachment 444920 [details] Patch
Created attachment 444932 [details] Patch make ShareableResource use thread-safe refcount. Previously CFAllocatorContext’s would have always called the deallocator on the main thread
Comment on attachment 444932 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=444932&action=review > Source/WebKit/ChangeLog:10 > + SharedMemory::createSharedBuffer instead. Nit: using SharedMemory::createSharedBuffer instead of ...?
Created attachment 445643 [details] Patch
Committed r286408 (244754@main): <https://commits.webkit.org/244754@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 445643 [details].