Please everybody, do not get carried away with the question whether the
fields should be "int" or "short" or 24 bits or whatever.

Just take plain int or long int, since we don't use specifically
sized types.

In the database, it can be compressed to whatever suitable size as with my
cut-the-db.words.db-file-in-half patch submitted just before 3.1.0
(Remember it?  Anyone opposed to me committing an updated version now?)

In computer memory, there are generally padding and alignment issues that
make the size non-obvious, but taking up the same room as if larger size
had been used, unless smaller sizes are stuffed together to minimize that
effect.  Consider:

struct foo
{
   short int bar;
   int baz;
};

This structure will take up 8 bytes in the ABI:s used in Intel-linux and
Sparc-solaris, regardless of the sum of 6 bytes for the individual
elements.  Same thing if "bar" had gone at the end, to make arrays of
foo:s aligned and individual structures the same size as array elements.
(Unless you play unportable games with compiler-specific attributes.)

I'm sure some of you know this, but some don't.

brgds, H-P


------------------------------------
To unsubscribe from the htdig3-dev mailing list, send a message to
[EMAIL PROTECTED] containing the single word "unsubscribe" in
the SUBJECT of the message.

Reply via email to