[Gambas-user] problems in trie class

Charlie Reinl Karl.Reinl at ...2345...
Sat Nov 29 22:53:33 CET 2014


Am Samstag, den 29.11.2014, 20:05 +0100 schrieb Tobias Boege:
> 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
> 

Salut Tobi,

yes, now no more crash, only an error raises, thats oK.
The leak shown, I can't reproduce any more now..... BUT
Now TriePrefix is case sensitive, in my follow-up the TriePrefix "d"
showed me "D" AND "d"entries, now only the "d", may be thats how trie
work normally, but for my behaves non case sensitive would be better (or
a switch to do like that) 
And we talked about something like <trie>.Add(Value,Key) for simplifing
filling.

Thanks anyway
-- 
Amicalement
Charlie





More information about the User mailing list