Fixed leaks in LM::operator[](const char *) and LM::clear_oov()
commit949bb936b42d8e20709544db5a3621906db32145
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Sat, 2 Dec 2006 11:39:45 +0000 (2 18:39 +0700)
committerNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Sat, 2 Dec 2006 11:39:45 +0000 (2 18:39 +0700)
tree9fbeca71bc9541871888973b3f66ab200cbfa4fc
parent5da9eca81cdc9788d011b11b6ea91f3b40443d78
Fixed leaks in LM::operator[](const char *) and LM::clear_oov()

LM::clear_oov() (also known as clear_rest) resizes LM::oov without
release memory allocated for its strings

LM::operator[](const char *) abused LM::lm->HT to index LM::oov.
This has a nasty effect that lm->HT keeps growing no matter you call
LM::clear_oov(). With lm->HT's growing bigger and bigger, hash lookup
slows down significantly.

The new implementation uses another hash for index oov and free it
when LM::clear_oov() is called
libvspell/dictionary.cpp
libvspell/dictionary.h