r22537 - gnucash/branches/2.4/src - [r22190]Since 2.32, GCache is deprecated and should be replaced by GHashTable.

John Ralls jralls at code.gnucash.org
Tue Nov 6 19:24:30 EST 2012


Author: jralls
Date: 2012-11-06 19:24:29 -0500 (Tue, 06 Nov 2012)
New Revision: 22537
Trac: http://svn.gnucash.org/trac/changeset/22537

Added:
   gnucash/branches/2.4/src/libqof/qof/qof-string-cache.c
   gnucash/branches/2.4/src/libqof/qof/qof-string-cache.h
Modified:
   gnucash/branches/2.4/src/app-utils/gnc-component-manager.c
   gnucash/branches/2.4/src/libqof/qof/Makefile.am
   gnucash/branches/2.4/src/libqof/qof/kvp_frame.c
   gnucash/branches/2.4/src/libqof/qof/qof.h
   gnucash/branches/2.4/src/libqof/qof/qofbook.c
   gnucash/branches/2.4/src/libqof/qof/qofutil.c
   gnucash/branches/2.4/src/libqof/qof/qofutil.h
   gnucash/branches/2.4/src/libqof/qof/test/test-qof.c
Log:
[r22190]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 removed, they don't work in the 2.4 branch because the testing infrastructure isn't in place.)



More information about the gnucash-patches mailing list