summaryrefslogtreecommitdiffstats
path: root/src/H5HFpkg.h
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2006-08-07 18:18:17 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2006-08-07 18:18:17 (GMT)
commit80b1c44327f56c2e7edd75389e5b3b5a9b5ea833 (patch)
tree11965f139ce5aca89f6f0840d1b97a609d042946 /src/H5HFpkg.h
parent9a03ce6406817238a4c9b7fc77cc9fbeac8636e1 (diff)
downloadhdf5-80b1c44327f56c2e7edd75389e5b3b5a9b5ea833.zip
hdf5-80b1c44327f56c2e7edd75389e5b3b5a9b5ea833.tar.gz
hdf5-80b1c44327f56c2e7edd75389e5b3b5a9b5ea833.tar.bz2
[svn-r12550] Description:
Refactor fractal heap IDs to include "flag byte" as part of the ID. This byte will be used for the heap ID format version as well as flags to indicate whether the heap object is a "tiny"/normal/"huge" object (with storage mechanisms optimized for each type of object). Platforms tested: Linux/32 2.4 (chicago) Too minor to require h5committest
Diffstat (limited to 'src/H5HFpkg.h')
-rw-r--r--src/H5HFpkg.h29
1 files changed, 25 insertions, 4 deletions
diff --git a/src/H5HFpkg.h b/src/H5HFpkg.h
index 6f3025d..b3b0951 100644
--- a/src/H5HFpkg.h
+++ b/src/H5HFpkg.h
@@ -114,16 +114,37 @@
#define H5HF_SIZEOF_OFFSET_BITS(b) (((b) + 7) / 8)
#define H5HF_SIZEOF_OFFSET_LEN(l) H5HF_SIZEOF_OFFSET_BITS(H5V_log2_of2((unsigned)(l)))
-/* Encode a heap ID */
-#define H5HF_ID_ENCODE(i, h, o, l) \
+/* Heap ID bit flags */
+/* Heap ID version (2 bits: 6-7) */
+#define H5HF_ID_VERS_CURR 0x00 /* Current version of ID format */
+#define H5HF_ID_VERS_MASK 0xC0 /* Mask for getting the ID version from flags */
+/* Heap ID type (2 bits: 4-5) */
+#define H5HF_ID_TYPE_MAN 0x00 /* "Managed" object - stored in fractal heap blocks */
+#define H5HF_ID_TYPE_HUGE 0x10 /* "Huge" object - stored in file directly */
+#define H5HF_ID_TYPE_TINY 0x20 /* "Tiny" object - stored in heap ID directly */
+#define H5HF_ID_TYPE_RESERVED 0x30 /* "?" object - reserved for future use */
+#define H5HF_ID_TYPE_MASK 0x30 /* Mask for getting the ID type from flags */
+/* Heap ID bits 0-3 reserved for future use */
+
+/* Encode a "managed" heap ID */
+#define H5HF_MAN_ID_ENCODE(i, h, o, l) \
+ *(uint8_t *)i++ = H5HF_ID_VERS_CURR | H5HF_ID_TYPE_MAN; \
UINT64ENCODE_VAR((i), (o), (h)->heap_off_size); \
UINT64ENCODE_VAR((i), (l), (h)->heap_len_size)
-/* Decode a heap ID */
-#define H5HF_ID_DECODE(i, h, o, l) \
+/* Decode a "managed" heap ID */
+#define H5HF_MAN_ID_DECODE(i, h, f, o, l) \
+ f = *(uint8_t *)i++; \
UINT64DECODE_VAR((i), (o), (h)->heap_off_size); \
UINT64DECODE_VAR((i), (l), (h)->heap_len_size)
+/* Size of ID for heap */
+#define H5HF_ID_SIZE(h) ( \
+ 1 /* ID flag byte */ \
+ + (h)->heap_off_size /* Space for managed object offset */ \
+ + (h)->heap_len_size /* Space for managed object length */ \
+ )
+
/* Free space section types for fractal heap */
/* (values stored in free space data structures in file) */
#define H5HF_FSPACE_SECT_SINGLE 0 /* Section is a range of actual bytes in a direct block */