<snip> > The void pointer array in WordEntry is simply a generic place to stick > some data. It is a rather common practice so I don't see how that is > hard to understand. The alternative would be to make WordEntry a virtual > base class. This will involve unnecessary allocation of dynamic memory and > functions calls. The way I decided WordEntry was that no extra dynamic > memory needs to be allocated, and in the common case of only one word no > functions calls are needed. I am unlikely to change it. > > The "(StrVector *)(s - sizeof(StrVector) - 2)" is there because it > simplified storing the data in the hash table. I am open to patches that > avoid it with out adding significant performance penalty or adding a lot > of extra code. Of course I expect the changes to self contained within > the file writable.cpp. > > Don't even think about changing readonly_ws.cpp the data there is very > carefully laid out to avoid wasting a lot of space with extra pointers. > Hi Kevin,
I understand your point of view. I started out working in assembly on a machine with inadequate memory and I've had to crunch code. It's been some years since I've had to put efficiency before maintainability. I thought that the software profession in general was moving the in maintainability direction. This may be one area where efficiency trumps maintainability. Even if you choose not to accept it, I plan to submit a patch to writable.cpp defines structs for how words and sounds like data is stored in the WordLookup and SoundslikeLookup. If I never try, I'll never know if making the change would be worth while. Puttering around with the code made me ask why you store the lengths with all word and soundslike data. It does not seem to be used except as a check against the null terminated length of strings. Is there a need with some languages or character sets to store nulls within words. Is there a chance of corruption and you need to redundancy? It would reduce the complexity if the soundslike data was not stored with string length. How do you feel about that change? Best regards, Gary _______________________________________________ Aspell-devel mailing list [EMAIL PROTECTED] http://lists.gnu.org/mailman/listinfo/aspell-devel