diff options
author | James Laird <jlaird@hdfgroup.org> | 2007-01-16 17:19:11 (GMT) |
---|---|---|
committer | James Laird <jlaird@hdfgroup.org> | 2007-01-16 17:19:11 (GMT) |
commit | 8fa9daa17424a76c715f63afc35cfdcd0c3add32 (patch) | |
tree | bd278f590332535b85d6b3c37d936809717aa171 /src/H5Tcommit.c | |
parent | 8e88c834ffaf3904105ff585087a09a69ed1a56f (diff) | |
download | hdf5-8fa9daa17424a76c715f63afc35cfdcd0c3add32.zip hdf5-8fa9daa17424a76c715f63afc35cfdcd0c3add32.tar.gz hdf5-8fa9daa17424a76c715f63afc35cfdcd0c3add32.tar.bz2 |
[svn-r13143] Refactoring.
Added can_share callback for OH messages. This determines whether the
message is allowed to be shared in the heap (committed and immutable datatypes
can't be).
Fixed a bug in the dense attribute storage that tried to open the shared message
heap when it hadn't been created yet.
Made the test to extend shared dataspace messages a bit more robust.
Refactored the code the searches a shared message list index to be a little
more efficient.
A few other minor changes.
Tested on smirom, kagiso, Windows, and juniper.
Diffstat (limited to 'src/H5Tcommit.c')
-rw-r--r-- | src/H5Tcommit.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c index d8fbe3b..bc213ae 100644 --- a/src/H5Tcommit.c +++ b/src/H5Tcommit.c @@ -134,25 +134,22 @@ done: /* If the datatype was committed but couldn't be linked, we need to return it to the state it was in * before it was committed. */ if(TRUE == uncommit) { -#ifdef JAMES - /* JAMES: I'm not convinced that this really works anyway */ - if(type->shared->state == H5T_STATE_OPEN && type->sh_loc.flags & H5O_COMMITTED_FLAG)) { + if(type->shared->state == H5T_STATE_OPEN && type->sh_loc.flags & H5O_COMMITTED_FLAG) { /* Remove the datatype from the list of opened objects in the file */ - if(H5FO_top_decr(type->oloc.file, type->oloc.addr) < 0) + if(H5FO_top_decr(type->sh_loc.u.oloc.file, type->sh_loc.u.oloc.addr) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "can't decrement count for object") - if(H5FO_delete(type->oloc.file, H5AC_dxpl_id, type->oloc.addr) < 0) + if(H5FO_delete(type->sh_loc.u.oloc.file, H5AC_dxpl_id, type->sh_loc.u.oloc.addr) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "can't remove dataset from list of open objects") - if(H5O_close(&(type->oloc)) < 0) + if(H5O_close(&(type->sh_loc.u.oloc)) < 0) HDONE_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, FAIL, "unable to release object header") - if(H5O_delete(file, H5AC_dxpl_id, type->oloc.addr) < 0) + if(H5O_delete(file, H5AC_dxpl_id, type->sh_loc.u.oloc.addr) < 0) HDONE_ERROR(H5E_DATATYPE, H5E_CANTDELETE, FAIL, "unable to delete object header") /* Mark datatype as being back in memory */ if(H5T_set_loc(type, file, H5T_LOC_MEMORY)) HDONE_ERROR(H5E_DATATYPE, H5E_CANTDELETE, FAIL, "unable to return datatype to memory") - type->oloc.addr = HADDR_UNDEF; + type->sh_loc.flags = H5O_NOT_SHARED; type->shared->state = old_state; } /* end if */ -#endif /* JAMES */ } /* end if */ FUNC_LEAVE_API(ret_value) |