On Sat, Sep 23, 2000 at 10:48:25AM -0700, [EMAIL PROTECTED] wrote:
> On 22 Sep, Chris Kuklewicz wrote:
> > Have a hash_set<char*> which holds new refcount 1 strings (and thus
> > has no int overhead), and a hash_map<char*, unsigned int> which holds
> > any refcount string.  A duplicate has to be searched for in both the
> > hash_map and hash_set when adding a new string.  When ++refcount on
> > char* in the hash_set, move char* to the hash_map with refcount 2.
> > Note: If the stored refcount in hash_map is zero, it means the string
> > is static and need never be freed, and the refcount stays at zero.
> > When --refcount, do not move char* back from hash_map to hash_set,
> > just leave it in hash_set with a refcount of 1.
> Interesting idea -- do you know how much memory overhead there is for a
> hash_map? I really like the not duplicating strings -- in the case of
> the data that we're throwing at it that would be a good way to save
> memory.
> Would you be interested in hacking on this?

I'm cooking up the storage classes right now.

Reply via email to