[Gambas-user] problems in trie class
Tobias Boege
taboege at ...626...
Sat Nov 29 20:05:29 CET 2014
On Tue, 18 Nov 2014, Karl Reinl wrote:
> Salut Tobi,
>
> played with you trie example (trietest) it crash if
> p = h.GetPrefix("texte") find nothing (p=null), even when change
> to p = h.GetPrefix("Texte")
>
> My change is h["texte"] to h["Texte"] (source attached)
Can you run your tests with #6688?
Indeed there were bit width errors (I think) but what caused your particular
error here was that a TriePrefix object would erroneously drop reference
counts of its parent Trie object if it couldn't be created. Total nonsense.
Thanks for your report!
As for the leak you showed in a follow-up, I couldn't reproduce that. I'll
try harder if the problem persists with #6688. But I can tell you that this
does not necessarily indicate a severe problem / corruption, as I don't
terminate strings in my trie backend code and it could just be some length
calculations that went wrong. (Most probably that is because the Gambas
string functions automatically use strlen() to determine a string's length
when I give 0 as a length parameter. However, strlen() must not be used on
the strings from my trie.)
Regards,
Tobi
--
"There's an old saying: Don't change anything... ever!" -- Mr. Monk
More information about the User
mailing list