summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2006-12-08 19:44:20 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2006-12-08 19:44:20 (GMT)
commit978c9c9d93fc51ea64c83256a97d72d51656bc3a (patch)
tree0f4064defe6e857fbcce12f26084aee7d8122645 /src
parent8f5f04bff27812dde0a888fceadaf1a3dc17cc8e (diff)
downloadhdf5-978c9c9d93fc51ea64c83256a97d72d51656bc3a.zip
hdf5-978c9c9d93fc51ea64c83256a97d72d51656bc3a.tar.gz
hdf5-978c9c9d93fc51ea64c83256a97d72d51656bc3a.tar.bz2
[svn-r13034] Description:
Take out separate memory type in the file for SOHM objects and create aliases for existing memory types for SOHM use. Tested on: FreeBSD/32 4.11 (sleipnir)
Diffstat (limited to 'src')
-rw-r--r--src/H5FDmulti.c6
-rw-r--r--src/H5FDpublic.h14
-rwxr-xr-xsrc/H5SM.c10
-rw-r--r--src/H5SMcache.c8
4 files changed, 25 insertions, 13 deletions
diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c
index 3e7e1aa..398cd86 100644
--- a/src/H5FDmulti.c
+++ b/src/H5FDmulti.c
@@ -379,7 +379,7 @@ H5Pset_fapl_split(hid_t fapl, const char *meta_ext, hid_t meta_plist_id,
* letters `s' (H5FD_MEM_SUPER),
* `b' (H5FD_MEM_BTREE), `r' (H5FD_MEM_DRAW),
* `g' (H5FD_MEM_GHEAP), 'l' (H5FD_MEM_LHEAP),
- * `o' (H5FD_MEM_OHDR), 'h' (H5FD_MEM_SOHM).
+ * `o' (H5FD_MEM_OHDR).
*
* memb_addr: The value HADDR_UNDEF for each element.
*
@@ -439,7 +439,7 @@ H5Pset_fapl_multi(hid_t fapl_id, const H5FD_mem_t *memb_map,
char _memb_name[H5FD_MEM_NTYPES][16];
const char *_memb_name_ptrs[H5FD_MEM_NTYPES];
haddr_t _memb_addr[H5FD_MEM_NTYPES];
- static const char *letters = "Xsbrglom";
+ static const char *letters = "Xsbrglo";
static const char *func="H5FDset_fapl_multi"; /* Function Name for error reporting */
/*NO TRACE*/
@@ -776,7 +776,7 @@ H5FD_multi_sb_encode(H5FD_t *_file, char *name/*out*/,
strncpy(name, "NCSAmulti", (size_t)8);
name[8] = '\0';
- assert(8==H5FD_MEM_NTYPES);
+ assert(7==H5FD_MEM_NTYPES);
for (m=H5FD_MEM_SUPER; m<H5FD_MEM_NTYPES; m=(H5FD_mem_t)(m+1))
buf[m-1] = (unsigned char)file->fa.memb_map[m];
buf[7] = 0;
diff --git a/src/H5FDpublic.h b/src/H5FDpublic.h
index bab96c0..e6467d5 100644
--- a/src/H5FDpublic.h
+++ b/src/H5FDpublic.h
@@ -39,7 +39,6 @@ typedef enum H5FD_mem_t {
H5FD_MEM_GHEAP = 4,
H5FD_MEM_LHEAP = 5,
H5FD_MEM_OHDR = 6,
- H5FD_MEM_SOHM = 7,
H5FD_MEM_NTYPES /*must be last*/
} H5FD_mem_t;
@@ -76,6 +75,19 @@ typedef enum H5FD_mem_t {
#define H5FD_MEM_FSPACE_HDR H5FD_MEM_OHDR
#define H5FD_MEM_FSPACE_SINFO H5FD_MEM_LHEAP
+/* Map "shared object header message" master table to 'ohdr' type file memory,
+ * since its a fair amount of work to add a new kind of file memory and they are
+ * similar enough to object headers and probably too minor to deserve their own
+ * type.
+ *
+ * Map "shared object header message" indices to 'btree' type file memory,
+ * since they are similar enough to B-tree nodes.
+ *
+ * -QAK
+ */
+#define H5FD_MEM_SOHM_TABLE H5FD_MEM_OHDR
+#define H5FD_MEM_SOHM_INDEX H5FD_MEM_BTREE
+
/*
* A free-list map which maps all types of allocation requests to a single
* free list. This is useful for drivers that don't really care about
diff --git a/src/H5SM.c b/src/H5SM.c
index c3c8d85..2654483 100755
--- a/src/H5SM.c
+++ b/src/H5SM.c
@@ -193,7 +193,7 @@ H5SM_init(H5F_t *f, H5P_genplist_t * fc_plist, hid_t dxpl_id)
/* Allocate space for the table on disk */
table_size = (hsize_t) H5SM_TABLE_SIZE(f) + (hsize_t) (table->num_indexes * H5SM_INDEX_HEADER_SIZE(f));
- if(HADDR_UNDEF == (table_addr = H5MF_alloc(f, H5FD_MEM_SOHM, dxpl_id, table_size)))
+ if(HADDR_UNDEF == (table_addr = H5MF_alloc(f, H5FD_MEM_SOHM_TABLE, dxpl_id, table_size)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "file allocation failed for SOHM table")
/* Cache the new table */
@@ -207,7 +207,7 @@ done:
if(ret_value < 0)
{
if(table_addr != HADDR_UNDEF)
- H5MF_xfree(f, H5FD_MEM_SOHM, dxpl_id, table_addr, (hsize_t)H5SM_TABLE_SIZE(f));
+ H5MF_xfree(f, H5FD_MEM_SOHM_TABLE, dxpl_id, table_addr, (hsize_t)H5SM_TABLE_SIZE(f));
if(table != NULL)
H5FL_FREE(H5SM_master_table_t, table);
}
@@ -455,7 +455,7 @@ H5SM_create_list(H5F_t *f, H5SM_index_header_t * header, hid_t dxpl_id)
/* Allocate space for the list on disk */
size = H5SM_LIST_SIZE(f, num_entries);
- if(HADDR_UNDEF == (addr = H5MF_alloc(f, H5FD_MEM_SOHM, dxpl_id, size)))
+ if(HADDR_UNDEF == (addr = H5MF_alloc(f, H5FD_MEM_SOHM_INDEX, dxpl_id, size)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, "file allocation failed for SOHM list")
/* Put the list into the cache */
@@ -475,7 +475,7 @@ done:
H5FL_FREE(H5SM_list_t, list);
}
if(addr != HADDR_UNDEF)
- H5MF_xfree(f, H5FD_MEM_SOHM, dxpl_id, addr, size);
+ H5MF_xfree(f, H5FD_MEM_SOHM_INDEX, dxpl_id, addr, size);
}
FUNC_LEAVE_NOAPI(ret_value)
@@ -731,7 +731,7 @@ H5SM_write_mesg(H5F_t *f, hid_t dxpl_id, H5SM_index_header_t *header,
list = NULL;
list_size = H5SM_LIST_SIZE(f, header->list_to_btree);
- if(H5MF_xfree(f, H5FD_MEM_SOHM, dxpl_id, header->index_addr, list_size) < 0)
+ if(H5MF_xfree(f, H5FD_MEM_SOHM_INDEX, dxpl_id, header->index_addr, list_size) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to free shared message list")
header->index_addr = tree_addr;
diff --git a/src/H5SMcache.c b/src/H5SMcache.c
index a74926f..6c9118e 100644
--- a/src/H5SMcache.c
+++ b/src/H5SMcache.c
@@ -161,7 +161,7 @@ H5SM_flush_table(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5SM_ma
/* Write the table to disk */
HDassert((size_t)(p - buf) == size);
- if(H5F_block_write(f, H5FD_MEM_SOHM, addr, size, dxpl_id, buf) < 0)
+ if(H5F_block_write(f, H5FD_MEM_SOHM_TABLE, addr, size, dxpl_id, buf) < 0)
HGOTO_ERROR(H5E_SOHM, H5E_CANTFLUSH, FAIL, "unable to save sohm table to disk")
table->cache_info.is_dirty = FALSE;
@@ -216,7 +216,7 @@ H5SM_load_table(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED *udata1
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
/* Read header from disk */
- if(H5F_block_read(f, H5FD_MEM_SOHM, addr, table_size, dxpl_id, buf) < 0)
+ if(H5F_block_read(f, H5FD_MEM_SOHM_TABLE, addr, table_size, dxpl_id, buf) < 0)
HGOTO_ERROR(H5E_SOHM, H5E_READERROR, NULL, "can't read SOHM table")
p = buf;
@@ -438,7 +438,7 @@ H5SM_flush_list(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5SM_lis
/* Write the list to disk */
HDassert((size_t)(p - buf) == size);
- if(H5F_block_write(f, H5FD_MEM_SOHM, addr, size, dxpl_id, buf) < 0)
+ if(H5F_block_write(f, H5FD_MEM_SOHM_INDEX, addr, size, dxpl_id, buf) < 0)
HGOTO_ERROR(H5E_SOHM, H5E_CANTFLUSH, FAIL, "unable to save sohm table to disk")
list->cache_info.is_dirty = FALSE;
@@ -503,7 +503,7 @@ H5SM_load_list(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED *udata1,
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
/* Read list from disk */
- if(H5F_block_read(f, H5FD_MEM_SOHM, addr, size, dxpl_id, buf) < 0)
+ if(H5F_block_read(f, H5FD_MEM_SOHM_INDEX, addr, size, dxpl_id, buf) < 0)
HGOTO_ERROR(H5E_SOHM, H5E_READERROR, NULL, "can't read SOHM list")
p = buf;