Bug 34970 - decides whether to cache a used message based on length, not allocation
Summary: decides whether to cache a used message based on length, not allocation
Status: RESOLVED WONTFIX
Alias: None
Product: dbus
Classification: Unclassified
Component: core (show other bugs)
Version: unspecified
Hardware: Other All
: low minor
Assignee: Simon McVittie
QA Contact: John (J5) Palmieri
URL: http://git.collabora.co.uk/?p=user/sm...
Whiteboard:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2011-03-03 04:39 UTC by Simon McVittie
Modified: 2012-02-21 08:42 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
DBusString: add _dbus_string_get_allocated (2.33 KB, patch)
2011-03-07 09:50 UTC, Simon McVittie
Details | Splinter Review
DBusMessage: only cache messages that don't have too many bytes allocated (952 bytes, patch)
2011-03-07 09:50 UTC, Simon McVittie
Details | Splinter Review

Description Simon McVittie 2011-03-03 04:39:00 UTC
The global message cache in dbus-message.c avoids caching message objects where the total length (header + body) is larger than MAX_MESSAGE_SIZE_TO_CACHE.

However, this doesn't account for possible over-allocations in DBusString: we should probably base the decision on DBusRealString::allocated rather than DBusRealString::length?
Comment 1 Simon McVittie 2011-03-03 04:43:47 UTC
(Please disregard the original title of this bug, which was misleading.)
Comment 2 Simon McVittie 2011-03-07 09:50:32 UTC
Created attachment 44205 [details] [review]
DBusString: add _dbus_string_get_allocated
Comment 3 Simon McVittie 2011-03-07 09:50:51 UTC
Created attachment 44206 [details] [review]
DBusMessage: only cache messages that don't have too many bytes allocated
Comment 4 Lennart Poettering 2011-03-09 19:47:18 UTC
Looks good.

(But is the difference really that big that this matters?)
Comment 5 Simon McVittie 2012-02-21 08:42:47 UTC
(In reply to comment #4)
> (But is the difference really that big that this matters?)

Since messages are effectively add-only, I doubt it.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.