[Webkit-unassigned] [Bug 61287] [UNIX] Don't use SOCK_DGRAM in socketpair()
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu May 26 03:23:44 PDT 2011
https://bugs.webkit.org/show_bug.cgi?id=61287
--- Comment #20 from Carlos Garcia Campos <cgarcia at igalia.com> 2011-05-26 03:23:44 PST ---
(In reply to comment #19)
> (In reply to comment #17)
> > And the same code would work on windows too.
>
> I don't think it's the correct solution to windows IPC.
Yes, you are right, and I agree using low level apis might be more robust even if it's more code and I think it's good sharing code.
When you say the message is buffered redundantly, what do you mean? Comparing current code and the patch we have the followingf heap allocations:
- Current code: We allocate the readBuffer in platformInitialize(), then everytime readyReadHandler() is called
+ attachmentDescriptorBuffer is allocated/deallocated
+ attachmentSizes is allocated/deallocated
+ fileDescriptors is allocated/deallocated
- With the patch: We allocate readBuffer and fileDescriptors buffers in platformInitialize(), then everytime readyReadHandler() is called:
+ attachmentDescriptorBuffer is allocated/deallocated in readBytesFromSocket()
+ attachmentSizes is allocated/deallocated in processMessage()
So we are even reducing the number of allocations/deallocations. We could avoid also attachmentDescriptorBuffer allocation in both cases using alloca() if available.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list