summaryrefslogtreecommitdiffstats
path: root/src/H5FSsection.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-08-15 07:03:44 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-08-15 07:03:44 (GMT)
commit6c5e37a5938f3dc614f908d5d955b3103db4f367 (patch)
tree26cf3732aac362d9014ae0d9e81bd62767d6fe83 /src/H5FSsection.c
parent58067df6c710c92c596ceac6b570f085e69c25d4 (diff)
downloadhdf5-6c5e37a5938f3dc614f908d5d955b3103db4f367.zip
hdf5-6c5e37a5938f3dc614f908d5d955b3103db4f367.tar.gz
hdf5-6c5e37a5938f3dc614f908d5d955b3103db4f367.tar.bz2
[svn-r17366] Description:
Bring r17346:17365 from trunk to revise_chunks branch Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode Mac OS X/32 10.5.8 (amazon) in debug mode Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode
Diffstat (limited to 'src/H5FSsection.c')
-rw-r--r--src/H5FSsection.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/H5FSsection.c b/src/H5FSsection.c
index 51229cb..26ff7b9 100644
--- a/src/H5FSsection.c
+++ b/src/H5FSsection.c
@@ -1124,7 +1124,6 @@ done:
} /* H5FS_sect_link() */
-
/*-------------------------------------------------------------------------
* Function: H5FS_sect_merge
*
@@ -1508,10 +1507,15 @@ if(_section_)
* (or it would have been eliminated), etc)
*/
if(sect->size >= extra_requested && (addr + size) == sect->addr) {
+ H5FS_section_class_t *cls; /* Section's class */
+
/* Remove section from data structures */
if(H5FS_sect_remove_real(fspace, sect) < 0)
HGOTO_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't remove section from internal data structures")
+ /* Get class for section */
+ cls = &fspace->sect_cls[sect->type];
+
/* Check for the section needing to be adjusted and re-added */
/* (Note: we should probably add a can_adjust/adjust callback
* to the section class structure, but we don't need it
@@ -1519,11 +1523,6 @@ if(_section_)
* it. - QAK - 2008/01/08)
*/
if(sect->size > extra_requested) {
- H5FS_section_class_t *cls; /* Section's class */
-
- /* Get class for section */
- cls = &fspace->sect_cls[sect->type];
-
/* Sanity check (for now) */
HDassert(cls->flags & H5FS_CLS_ADJUST_OK);
@@ -1535,6 +1534,14 @@ if(_section_)
if(H5FS_sect_link(fspace, sect, 0) < 0)
HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, FAIL, "can't insert free space section into skip list")
} /* end if */
+ else {
+ /* Sanity check */
+ HDassert(sect->size == extra_requested);
+
+ /* Exact match, so just free section */
+ if((*cls->free)(sect) < 0)
+ HGOTO_ERROR(H5E_FSPACE, H5E_CANTFREE, FAIL, "can't free section")
+ } /* end else */
/* Note that we modified the section info */
sinfo_modified = TRUE;