Re: G_LOCK_DECLARE -> G_LOCK_DEFINE



On Tue, 2 Feb 1999, Sebastian Wilhelmi wrote:

> Hi,
> 
> for reasons already stated(*), I would like to rename G_LOCK_DECLARE to
> G_LOCK_DEFINE and get rid of G_LOCK_DECLARE_STATIC. This is done by the
> following patch. It does not procude warnings and does not produce extra
> code, if glib is configured with `--disable-threads'. It does however
> allocate memory for the LOCK with the size of a gpointer each (there are
> 16 LOCKS used by glib). That sums up to 16 * 4 = 64 Bytes on most systems
> and should be acceptable, if you consider the increased coherency.
> 
> I could say, that if noone objects, I'll commit this, but I think, thats a
> bit unsuited in that special case, so please Owen and Tim, approve or
> disapprove this.
> 
> BTW.: No software other than glib on the gnome cvs server is using those
> macros, so we can still change that, and we should before a release.

hi Sebastian,

i talked about this with owen on irc and the consensus was, please apply
the s/DECLARE/DEFINE/ part of your patch but leave the _STATIC variants
in place. the reason for keeping the "static" qualifier within the macro
definition is to away optimize the whole variable declaration for
--disable-threads. eventhough that will currently only safe a minor amount
of memory in glib itself (the 64btyes you mentioned above), with 1.2 people
will start to use the G_LOCK* interface outside of glib and then, unneccessary
allocations would increase (if we have the ability to work around the extra
allocations with the _STATIC variants, we should make use of it).

> (*) K&R and ANSI-C use the term declaration for making an object known to
> the program and the term definition for assigning memory for an object.
> 
> Bye,
> Sebastian
> -- 
> Sebastian Wilhelmi                   |            här ovanför alla molnen
> mailto:wilhelmi@ira.uka.de           |      är himmlen så förunerligt blå
> http://goethe.ira.uka.de/~wilhelmi   |
> 

---
ciaoTJ




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