Bug 57559 - Don't use _GET_PRIVATE all the time
Summary: Don't use _GET_PRIVATE all the time
Status: RESOLVED FIXED
Alias: None
Product: Spice
Classification: Unclassified
Component: spice-gtk (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Spice Bug List
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-26 15:10 UTC by Alexander Larsson
Modified: 2014-09-02 08:48 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Use ->priv where possible. (48.35 KB, patch)
2012-11-26 15:11 UTC, Alexander Larsson
Details | Splinter Review

Description Alexander Larsson 2012-11-26 15:10:25 UTC
We already have priv members in the structs, which are much much faster.
Comment 1 Alexander Larsson 2012-11-26 15:11:31 UTC
Created attachment 70595 [details] [review]
Use ->priv where possible.
Comment 2 Marc-Andre Lureau 2012-11-26 16:55:01 UTC
Comment on attachment 70595 [details] [review]
Use ->priv where possible.

Review of attachment 70595 [details] [review]:
-----------------------------------------------------------------

(In reply to comment #0)
> We already have priv members in the structs, which are much much faster.

I don't think faster is really an argument here, given the rate at which we call those functions. However, I like the type-safety we had, especially on the public functions.  Can you add SPICE_FOO(obj) checks in the public methods with this patch?
Comment 3 Alexander Larsson 2012-11-27 09:01:16 UTC
I don't think the performance really matters no, it just seems weird to use this slow complex thing when we have the priv in the public structures.

However, i agree that its nice to have the typechecks.
Comment 4 Fabiano Fidêncio 2014-07-15 14:28:47 UTC
Patch sent to ML, based on Alex patch and following Marc-Andre's recommendations:
http://lists.freedesktop.org/archives/spice-devel/2014-July/017083.html


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.