struct clausenode
{
db_uint8 bcode; /**< Binary code data for
clause. */
db_uint8 clause_i; /**< Clause index.
*/
db_int start; /**< Clause start offset.
*/
db_int end; /**< Clause end offset.
*/
db_uint8 terms; /**< Number of terms in clause.
*/
};
This will (on 32-bit platform) waste 2 bytes after clause_i, then 3 bytes after terms. Rather, smaller members should be put towards the end of structure. In that case, only 1 byte will be wasted.
Take as an example:
This will (on 32-bit platform) waste 2 bytes after clause_i, then 3 bytes after terms. Rather, smaller members should be put towards the end of structure. In that case, only 1 byte will be wasted.