[webkit-reviews] review granted: [Bug 122516] Avoid resizing the internal buffer of SharedBuffer when creating a PurgeableBuffer : [Attachment 213729] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Oct 8 22:18:47 PDT 2013
Darin Adler <darin at apple.com> has granted Daniel Bates <dbates at webkit.org>'s
request for review:
Bug 122516: Avoid resizing the internal buffer of SharedBuffer when creating a
PurgeableBuffer
https://bugs.webkit.org/show_bug.cgi?id=122516
Attachment 213729: Patch
https://bugs.webkit.org/attachment.cgi?id=213729&action=review
------- Additional Comments from Darin Adler <darin at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=213729&action=review
> Source/WebCore/platform/SharedBuffer.cpp:233
> + char* destination = nullptr;
I don’t think this needs to be initialized.
> Source/WebCore/platform/mac/PurgeableBufferMac.cpp:86
> + char* buffer = allocatePurgeableBuffer(size);
> + if (!buffer)
> + return nullptr;
> + memcpy(buffer, data, size);
> + return adoptPtr(new PurgeableBuffer(buffer, size));
Seems like this could just call createUninitialized and then do the memcpy. No
need for the allocatePurgeableBuffer function at all.
More information about the webkit-reviews
mailing list