Re: Font button



On Mon, 2003-06-30 at 11:07, Soeren Sandmann wrote:
> Matthias Clasen <maclas gmx de> writes:
> 
> > I've just attached new versions of these to
> > http://bugzilla.gnome.org/show_bug.cgi?id=107682 and
> > http://bugzilla.gnome.org/show_bug.cgi?id=107597
> > 
> > Changes wrt to the previous versions:
> > - reduced some excessively long function names
> > - moved to instance private data
> > - improved documentation
> > - fixed a few bugs noticed while doing the above
> > 
> > 
> > I'm going to commit these in a few days, if nobody has further comments.
> 
> 	- Why move to instatnce private data for a new widget?
> 	  I would think that the priv pointer is fine.

What I've been promoting for new widgets is ->priv pointer pointing
to instance-private-data.

Reasons for using instance-private-data:
 
 - No need to write g_new0() / g_free() code; works just like
   part of the normal instance structure

 - Allocated in the main widget block; this saves a couple
   of bytes and a bit of time of malloc overhead.

Reason for using ->priv pointer:

 - IPD lookup is a bit more expensive than one might like... there
   are multiple function calls .. it's probably several hundred
   cycles.

Regards,
					Owen






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]