Bug 62663 - Add functions for encoding/decoding data with a known size and alignment
Summary: Add functions for encoding/decoding data with a known size and alignment
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Anders Carlsson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-14 14:11 PDT by Anders Carlsson
Modified: 2011-06-14 14:39 PDT (History)
1 user (show)

See Also:


Attachments
Patch (3.70 KB, patch)
2011-06-14 14:13 PDT, Anders Carlsson
no flags Details | Formatted Diff | Diff
Patch (3.72 KB, patch)
2011-06-14 14:35 PDT, Anders Carlsson
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anders Carlsson 2011-06-14 14:11:32 PDT
Add functions for encoding/decoding data with a known size and alignment
Comment 1 Anders Carlsson 2011-06-14 14:13:13 PDT
Created attachment 97166 [details]
Patch
Comment 2 Darin Adler 2011-06-14 14:28:05 PDT
Comment on attachment 97166 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=97166&action=review

> Source/WebKit2/Platform/CoreIPC/ArgumentDecoder.cpp:110
> +    memcpy(data, m_bufferPos, size);

I don’t get it.

Don’t you need to call roundUpToAlignment on m_bufferPos? Or just call alignBufferPosition instead?

Don’t you need to do m_bufferPos += size?
Comment 3 Anders Carlsson 2011-06-14 14:34:53 PDT
(In reply to comment #2)
> (From update of attachment 97166 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=97166&action=review
> 
> > Source/WebKit2/Platform/CoreIPC/ArgumentDecoder.cpp:110
> > +    memcpy(data, m_bufferPos, size);
> 
> I don’t get it.
> 
> Don’t you need to call roundUpToAlignment on m_bufferPos? Or just call alignBufferPosition instead?
> 

Yeah, bufferIsLargeEnoughToContain should be alignBufferPosition.

> Don’t you need to do m_bufferPos += size?

Yes.

New patch coming up.
Comment 4 Anders Carlsson 2011-06-14 14:35:11 PDT
Created attachment 97167 [details]
Patch
Comment 5 Anders Carlsson 2011-06-14 14:39:36 PDT
Committed r88853: <http://trac.webkit.org/changeset/88853>