summaryrefslogtreecommitdiffstats
path: root/src/H5SMpkg.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5SMpkg.h')
-rwxr-xr-xsrc/H5SMpkg.h75
1 files changed, 46 insertions, 29 deletions
diff --git a/src/H5SMpkg.h b/src/H5SMpkg.h
index 72be9f7..8d987a9 100755
--- a/src/H5SMpkg.h
+++ b/src/H5SMpkg.h
@@ -39,38 +39,55 @@
/****************************/
/* Package Macros */
/****************************/
-#define H5SM_LIST_MAGIC "SMLI"
-#define H5SM_LIST_SIZEOF_MAGIC 4
-#define H5SM_TABLE_MAGIC "SMTB"
-#define H5SM_TABLE_SIZEOF_MAGIC 4
-#define H5SM_SIZEOF_CHECKSUM 4
-
-#define H5SM_HEAP_LOC_SIZE (4 /* Reference count */ \
- + sizeof(H5O_fheap_id_t)) /* size of heap ID on disk */
-#define H5SM_OH_LOC_SIZE(f) (1 /* reserved (possible flags?) */ \
- + 1 /* message type ID */ \
- + 2 /* creation index of message in OH */ \
- + H5F_SIZEOF_ADDR(f)) /* address of OH */
+/* Size of signature information (on disk) */
+#define H5SM_SIZEOF_MAGIC 4
-#define H5SM_SOHM_ENTRY_SIZE(f) (1 /* Message location */ \
- + 4 /* Hash value */ \
- + MAX(H5SM_HEAP_LOC_SIZE, H5SM_OH_LOC_SIZE(f)))
+/* Shared Message signatures */
+#define H5SM_TABLE_MAGIC "SMTB" /* Shared Message Table */
+#define H5SM_LIST_MAGIC "SMLI" /* Shared Message List */
-#define H5SM_TABLE_SIZE(f) ( H5SM_TABLE_SIZEOF_MAGIC \
- + H5SM_SIZEOF_CHECKSUM) /* Checksum */
-
-#define H5SM_INDEX_HEADER_SIZE(f) (1 /* Whether index is a list or B-tree */ \
- + 1 /* Version of index format */ \
- + 2 /* Type of messages stored in the index */ \
- + 4 /* Minimum size of messages to share */ \
- + (3 * 2) /* B-tree cutoff, list cutoff, # of shared messages */ \
- + H5F_SIZEOF_ADDR(f) /* Location of list or B-tree */ \
- + H5F_SIZEOF_ADDR(f)) /* Address of heap */
+/* Size of checksum information (on disk) */
+#define H5SM_SIZEOF_CHECKSUM 4
-#define H5SM_LIST_SIZE(f, num_mesg) H5SM_LIST_SIZEOF_MAGIC \
- + (H5SM_SOHM_ENTRY_SIZE(f) * num_mesg) \
- + H5SM_SIZEOF_CHECKSUM /* Checksum */
+#define H5SM_HEAP_LOC_SIZE ( \
+ 4 /* Reference count */ \
+ + sizeof(H5O_fheap_id_t) /* size of heap ID on disk */ \
+ )
+
+#define H5SM_OH_LOC_SIZE(f) ( \
+ 1 /* reserved (possible flags?) */ \
+ + 1 /* message type ID */ \
+ + 2 /* creation index of message in OH */ \
+ + H5F_SIZEOF_ADDR(f) /* address of OH */ \
+ )
+
+#define H5SM_SOHM_ENTRY_SIZE(f) ( \
+ 1 /* Message location */ \
+ + 4 /* Hash value */ \
+ + MAX(H5SM_HEAP_LOC_SIZE, H5SM_OH_LOC_SIZE(f)) /* Entry */ \
+ )
+
+#define H5SM_TABLE_SIZE(f) ( \
+ H5SM_SIZEOF_MAGIC /* Signature */ \
+ + H5SM_SIZEOF_CHECKSUM /* Checksum */ \
+ )
+
+#define H5SM_INDEX_HEADER_SIZE(f) ( \
+ 1 /* Whether index is a list or B-tree */ \
+ + 1 /* Version of index format */ \
+ + 2 /* Type of messages stored in the index */ \
+ + 4 /* Minimum size of messages to share */ \
+ + (3 * 2) /* B-tree cutoff, list cutoff, # of shared messages */ \
+ + H5F_SIZEOF_ADDR(f) /* Location of list or B-tree */ \
+ + H5F_SIZEOF_ADDR(f) /* Address of heap */ \
+ )
+
+#define H5SM_LIST_SIZE(f, num_mesg) ( \
+ H5SM_SIZEOF_MAGIC /* Signature */ \
+ + (H5SM_SOHM_ENTRY_SIZE(f) * num_mesg) /* Message entries */ \
+ + H5SM_SIZEOF_CHECKSUM /* Checksum */ \
+ )
#define H5SM_B2_NODE_SIZE 512
#define H5SM_B2_SPLIT_PERCENT 100
@@ -168,7 +185,7 @@ struct H5SM_master_table_t {
/* Information for H5AC cache functions, _must_ be first field in structure */
H5AC_info_t cache_info;
- uint8_t num_indexes; /* Number of indexes */
+ unsigned num_indexes; /* Number of indexes */
H5SM_index_header_t *indexes; /* Array of num_indexes indexes */
};