Cleaned up and optimized Message2.cpp. It avoids as many unnecessary copies as it can now.
The unflatten time is now reduced to about a third of the current BMessage implementation but it's still about half as quick as R5 (we're talking about microseconds here). A third version of BMessage that operates purely on a flat buffer is in the works. We'll see which one will be faster for normal uses. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13821 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -41,6 +41,7 @@ public:
|
||||
|
||||
ssize_t FlattenedSize() const;
|
||||
status_t Flatten(BDataIO *stream) const;
|
||||
status_t Unflatten(BDataIO *stream);
|
||||
|
||||
status_t AddData(const char *name, BMallocIO *buffer,
|
||||
type_code type);
|
||||
@@ -68,8 +69,10 @@ public:
|
||||
|
||||
private:
|
||||
status_t InitCommon();
|
||||
BMessageField *AddField(const char *name, type_code type,
|
||||
status_t &error);
|
||||
BMessageField *FindData(const char *name, type_code type,
|
||||
status_t &error) const;
|
||||
status_t &error) const;
|
||||
|
||||
BList fFieldList;
|
||||
BMessageField **fFieldTable;
|
||||
|
||||
Reference in New Issue
Block a user