changeset 69:8cef827d2d79 HEAD

MailHashHeader is now 8-byte aligned. Fixed other header alignments too and stored MEM_ALIGN_SIZE into compat_data[].
author Timo Sirainen <tss@iki.fi>
date Wed, 28 Aug 2002 21:20:19 +0300
parents 9381df54c9c3
children 0e58a036265e
files src/lib-index/mail-hash.h src/lib-index/mail-index.c src/lib-index/mail-index.h
diffstat 3 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mail-hash.h	Wed Aug 28 21:06:44 2002 +0300
+++ b/src/lib-index/mail-hash.h	Wed Aug 28 21:20:19 2002 +0300
@@ -8,6 +8,8 @@
 	unsigned int indexid;
 	unsigned int updateid;
 	unsigned int used_records;
+
+	unsigned int alignment;
 };
 
 struct _MailHashRecord {
--- a/src/lib-index/mail-index.c	Wed Aug 28 21:06:44 2002 +0300
+++ b/src/lib-index/mail-index.c	Wed Aug 28 21:20:19 2002 +0300
@@ -372,7 +372,8 @@
 		hdr->compat_data[1] == MAIL_INDEX_COMPAT_FLAGS &&
 		hdr->compat_data[2] == sizeof(unsigned int) &&
 		hdr->compat_data[3] == sizeof(time_t) &&
-		hdr->compat_data[4] == sizeof(uoff_t);
+		hdr->compat_data[4] == sizeof(uoff_t) &&
+		hdr->compat_data[5] == MEM_ALIGN_SIZE;
 }
 
 /* Returns TRUE if we're compatible with given index file */
@@ -574,6 +575,7 @@
 	hdr->compat_data[2] = sizeof(unsigned int);
 	hdr->compat_data[3] = sizeof(time_t);
 	hdr->compat_data[4] = sizeof(uoff_t);
+	hdr->compat_data[5] = MEM_ALIGN_SIZE;
 	hdr->indexid = ioloop_time;
 
 	/* mark the index being rebuilt - rebuild() removes this flag
--- a/src/lib-index/mail-index.h	Wed Aug 28 21:06:44 2002 +0300
+++ b/src/lib-index/mail-index.h	Wed Aug 28 21:20:19 2002 +0300
@@ -77,7 +77,8 @@
 	   1 = flags,
 	   2 = sizeof(unsigned int),
 	   3 = sizeof(time_t),
-	   4 = sizeof(uoff_t) */
+	   4 = sizeof(uoff_t),
+	   5 = MEM_ALIGN_SIZE */
 
 	unsigned int indexid;
 	unsigned int flags;
@@ -98,8 +99,6 @@
 	/* these UIDs may not exist and may not even be unseen */
 	unsigned int first_unseen_uid_lowwater;
 	unsigned int first_deleted_uid_lowwater;
-
-	unsigned int reserved_for_future_usage[5];
 };
 
 struct _MailIndexDataHeader {