Re: Aspell core dump

Kevin Atkinson <[email protected]>
Newsgroups gmane.comp.gnu.aspell.devel
Message-ID <Pine.LNX.4.44.0412161150350.23536-100000@kevin-p3.atkinson.dhs.org>
On Thu, 16 Dec 2004, Gary Setter wrote:

> I would say that the code is difficult to understand. It does not
> seem to me to be "solid code". To make a change, like adding a
> field to whatever WritableBase::word_lookup holds would involve
> exhaustive study of the whole module. Even after much study, you
> would never be completely sure if your change broke someone
> else's assumption. To just document it as it is would be
> something of a cop out.

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.


-- 
http://kevin.atkinson.dhs.org
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.