#183 ensure only one instance of each dict is in memory

open
nobody
None
5
2011-02-03
2011-02-03
No

Use Case:
Lokalize (computer-aided translation system) uses standard KDE plugins for spell checking (in my case enchant plugin uses hunspell library)

Also i create Hunspell instance directly for stemming purposes, so this means there is two dict instances in RAM for each language (dict file)
Massif tool of valgrind report Hunspell::Hunspell() -> HashMgr::HashMgr() -> HashMgr::load_tables() -> HashMgr::add_word() allocating and keeping 12 megs of RAM in my case.

Is it possible that you add some static map that maps dict filepath to a Hunspell*?
Then a static Hunspell*-returning method may be added to Hunspell api.
P.S. i think it would be wise to protect access to internal data structures for each dict with mutexes (or at least their creation and deletion)

Discussion

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks