Re: Patch to allow GRelations > size 2

Russell Keith-Magee <> writes:

> Hi all,
> I've been playing around with GRelations of late - potentially quite 
> useful, but completely hobbled by the size == 2 restriction.
> I've attached a quick and dirty patch to glib-1.2.6 to allow relations 
> of size 3 and 4; The hashing function is just the addition of the 
> integer values of the pointers - crude but effective (or at least, more 
> effective than not having a hashing function at all :-). I submit this 
> unto the Powers That Be for rolling into CVS.
> However, this is really just a stop-gap measure (in particular, an ); if 
> glib provides for relations up to size n, someone will always want to 
> use a relation of size n+1. 
> It would seem to make sense (at least to me) to have a 
> g_relation_new_full function, which allows the user to define and use 
> their own hashing function, of a size appropriate for their application. 
> If anyone else thinks this is a good idea, I will put together a patch.

Thanks for the patch. I've asked Josh MacDonald (who wrote GRelation) to
look at it.


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