summaryrefslogtreecommitdiffstats
path: root/src/H5SMcache.c
diff options
context:
space:
mode:
authorJames Laird <jlaird@hdfgroup.org>2006-12-15 21:28:17 (GMT)
committerJames Laird <jlaird@hdfgroup.org>2006-12-15 21:28:17 (GMT)
commit9236c9a148aaf206294be0554cf78e7ab769bd51 (patch)
treeafa397f1439fd0b6a45592cfc062102ea160d479 /src/H5SMcache.c
parentaa646b5b43361597e547cea18af1825b43ad8ecb (diff)
downloadhdf5-9236c9a148aaf206294be0554cf78e7ab769bd51.zip
hdf5-9236c9a148aaf206294be0554cf78e7ab769bd51.tar.gz
hdf5-9236c9a148aaf206294be0554cf78e7ab769bd51.tar.bz2
[svn-r13065] Added support for copying shared messages (including turning unshared
messages to shared messages and vice versa). Extended objcopy test to test all "permutations" of shared/unshared and new/old group format. If this proves to take a long time to test, I'll go back and have it run fewer tests when HDF5_TEST_EXPRESS is enabled. Tested on smirom, kagiso, copper, and Windows.
Diffstat (limited to 'src/H5SMcache.c')
-rw-r--r--src/H5SMcache.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/H5SMcache.c b/src/H5SMcache.c
index 6c9118e..155a3ab 100644
--- a/src/H5SMcache.c
+++ b/src/H5SMcache.c
@@ -57,7 +57,7 @@
/* Local Prototypes */
/********************/
static herr_t H5SM_flush_table(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5SM_master_table_t *table);
-static H5SM_master_table_t *H5SM_load_table(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *udata1, H5SM_master_table_t *table);
+static H5SM_master_table_t *H5SM_load_table(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *udata1, void *table);
static herr_t H5SM_clear_table(H5F_t *f, H5SM_master_table_t *table, hbool_t destroy);
static herr_t H5SM_dest_table(H5F_t *f, H5SM_master_table_t* table);
static herr_t H5SM_table_size(const H5F_t *f, const H5SM_master_table_t *table, size_t *size_ptr);
@@ -191,8 +191,9 @@ done:
*-------------------------------------------------------------------------
*/
static H5SM_master_table_t *
-H5SM_load_table(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED *udata1, H5SM_master_table_t *table)
+H5SM_load_table(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED *udata1, void UNUSED *udata2)
{
+ H5SM_master_table_t *table = NULL;
size_t table_size; /* Size of SOHM master table on disk */
uint8_t *buf=NULL; /* Reading buffer */
const uint8_t *p; /* Pointer into input buffer */
@@ -203,7 +204,16 @@ H5SM_load_table(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED *udata1
FUNC_ENTER_NOAPI(H5SM_load_table, NULL)
- HDassert(table);
+ /* Allocate space for the master table in memory */
+ if(NULL == (table = H5MM_calloc(sizeof(H5SM_master_table_t))))
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
+
+ /* Read number of indexes and version from file superblock */
+ table->num_indexes = f->shared->sohm_nindexes;
+ table->version = f->shared->sohm_vers;
+
+ HDassert(addr == f->shared->sohm_addr);
+ HDassert(addr != HADDR_UNDEF);
HDassert(table->num_indexes > 0);
/* Compute the size of the SOHM table header on disk. This is the "table" itself