r22190 - gnucash/trunk/src - Since 2.32, GCache is deprecated and should be replaced by GHashTable.

Phil Longstaff plongstaff at code.gnucash.org
Mon May 21 13:28:31 EDT 2012


Author: plongstaff
Date: 2012-05-21 13:28:30 -0400 (Mon, 21 May 2012)
New Revision: 22190
Trac: http://svn.gnucash.org/trac/changeset/22190

Added:
   gnucash/trunk/src/libqof/qof/qof-string-cache.c
   gnucash/trunk/src/libqof/qof/qof-string-cache.h
   gnucash/trunk/src/libqof/qof/test/test-qof-string-cache.c
Modified:
   gnucash/trunk/src/app-utils/gnc-component-manager.c
   gnucash/trunk/src/libqof/qof/Makefile.am
   gnucash/trunk/src/libqof/qof/kvp_frame.c
   gnucash/trunk/src/libqof/qof/qof.h
   gnucash/trunk/src/libqof/qof/qofbook.c
   gnucash/trunk/src/libqof/qof/qofutil.c
   gnucash/trunk/src/libqof/qof/qofutil.h
   gnucash/trunk/src/libqof/qof/test/Makefile.am
   gnucash/trunk/src/libqof/qof/test/test-qof.c
Log:
Since 2.32, GCache is deprecated and should be replaced by GHashTable.

In the new string cache (split out from qofutil.c/.h), the GHashTable has the
string as key and a small heap-allocated guint refcount as data.  The value is
allocated rather than being used by value because there is no way to just
modify the data field of an existing key.  The key would need to be changed at
the same time, which would free the old key value and invalidate all gchar
pointers of objects which have refs to the key.

Unit tests added as well.




More information about the gnucash-patches mailing list