Bug 38570 - DBusString has a concept of "maximum length" which is documented to be broken
Summary: DBusString has a concept of "maximum length" which is documented to be broken
Status: RESOLVED FIXED
Alias: None
Product: dbus
Classification: Unclassified
Component: core (show other bugs)
Version: 1.5
Hardware: Other All
: medium minor
Assignee: Simon McVittie
QA Contact: John (J5) Palmieri
URL: http://cgit.freedesktop.org/~smcv/dbu...
Whiteboard:
Keywords: patch
Depends on:
Blocks: dbus-1.5
  Show dependency treegraph
 
Reported: 2011-06-22 06:59 UTC by Simon McVittie
Modified: 2011-06-22 11:35 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
[PATCH 1/3] Split DBUS_GENERIC_STRING_PREAMBLE into sensible lines (1.43 KB, patch)
2011-06-22 07:00 UTC, Simon McVittie
Details | Splinter Review
[PATCH 2/3] Remove unused _dbus_string_copy_data_len, _dbus_string_steal_data_len (3.65 KB, patch)
2011-06-22 07:01 UTC, Simon McVittie
Details | Splinter Review
[PATCH 3/3] Remove maximum length field from DBusString (11.55 KB, patch)
2011-06-22 07:01 UTC, Simon McVittie
Details | Splinter Review

Description Simon McVittie 2011-06-22 06:59:50 UTC
-/* The max length thing is sort of a historical artifact
- * from a feature that turned out to be dumb; perhaps
- * we should purge it entirely.

Less code, fewer bugs!
Comment 1 Simon McVittie 2011-06-22 07:00:58 UTC
Created attachment 48285 [details] [review]
[PATCH 1/3] Split DBUS_GENERIC_STRING_PREAMBLE into sensible lines
Comment 2 Simon McVittie 2011-06-22 07:01:23 UTC
Created attachment 48286 [details] [review]
[PATCH 2/3] Remove unused _dbus_string_copy_data_len, _dbus_string_steal_data_len

They're only compiled when building tests.
Comment 3 Simon McVittie 2011-06-22 07:01:45 UTC
Created attachment 48287 [details] [review]
[PATCH 3/3] Remove maximum length field from DBusString

The source code says it's "a historical artifact from a feature that
turned out to be dumb". Respond accordingly!

This reduces sizeof (DBusString) by 20% on ILP32 architectures, which
can't hurt. (No reduction on LP64 architectures that align pointers
naturally, unfortunately.)
Comment 4 Will Thompson 2011-06-22 09:52:49 UTC
Review of attachment 48285 [details] [review]:

Looks fine
Comment 5 Will Thompson 2011-06-22 09:54:23 UTC
Review of attachment 48286 [details] [review]:

Seems reasonable.
Comment 6 Will Thompson 2011-06-22 10:19:55 UTC
Review of attachment 48287 [details] [review]:

This looks about right to me! I love the idea of a MAX_MAX_LENGTH.
Comment 7 Simon McVittie 2011-06-22 11:35:21 UTC
Thanks, fixed in master for 1.5.6.


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.