From ff3f6f1a677a780a425ac8b0ab1c45eca92b6ca0 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Fri, 7 Jun 2002 09:15:22 -0500 Subject: [svn-r5551] Purpose: Bug fix. Description: Added extra check to locations where metadata and "small data" blocks were being returned to the file's list of free space to avoid freeing 0-sized blocks. This should fix the problems in last night's daily tests. Platforms tested: FreeBSD 4.5 (sleipnir) --- src/H5F.c | 4 ++-- src/H5FD.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/H5F.c b/src/H5F.c index fcf0d84..b111971 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -2371,7 +2371,7 @@ H5F_flush(H5F_t *f, H5F_scope_t scope, hbool_t invalidate, if(invalidate) { if(f->shared->lf->feature_flags&H5FD_FEAT_AGGREGATE_METADATA) { /* Return the unused portion of the metadata block to a free list */ - if(f->shared->lf->eoma!=0) + if(f->shared->lf->eoma!=0 && f->shared->lf->cur_meta_block_size!=0) if(H5FD_free(f->shared->lf,H5FD_MEM_DEFAULT,f->shared->lf->eoma,f->shared->lf->cur_meta_block_size)<0) HRETURN_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "can't free metadata block"); @@ -2381,7 +2381,7 @@ H5F_flush(H5F_t *f, H5F_scope_t scope, hbool_t invalidate, } /* end if */ if(f->shared->lf->feature_flags&H5FD_FEAT_AGGREGATE_SMALLDATA) { /* Return the unused portion of the "small data" block to a free list */ - if(f->shared->lf->eosda!=0) + if(f->shared->lf->eosda!=0 && f->shared->lf->cur_sdata_block_size!=0) if(H5FD_free(f->shared->lf,H5FD_MEM_DRAW,f->shared->lf->eosda,f->shared->lf->cur_sdata_block_size)<0) HRETURN_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "can't free 'small data' block"); diff --git a/src/H5FD.c b/src/H5FD.c index 55661aa..cd16130 100644 --- a/src/H5FD.c +++ b/src/H5FD.c @@ -1467,7 +1467,7 @@ H5FD_alloc(H5FD_t *file, H5FD_mem_t type, hsize_t size) } /* end if */ else { /* Return the unused portion of the metadata block to a free list */ - if(file->eoma!=0) + if(file->eoma!=0 && file->cur_meta_block_size!=0) if(H5FD_free(file,H5FD_MEM_DEFAULT,file->eoma,file->cur_meta_block_size)<0) HRETURN_ERROR(H5E_VFL, H5E_CANTFREE, HADDR_UNDEF, "can't free metadata block"); @@ -1536,7 +1536,7 @@ H5FD_alloc(H5FD_t *file, H5FD_mem_t type, hsize_t size) } /* end if */ else { /* Return the unused portion of the "small data" block to a free list */ - if(file->eosda!=0) + if(file->eosda!=0 && file->cur_sdata_block_size!=0) if(H5FD_free(file,H5FD_MEM_DRAW,file->eosda,file->cur_sdata_block_size)<0) HRETURN_ERROR(H5E_VFL, H5E_CANTFREE, HADDR_UNDEF, "can't free 'small data' block"); -- cgit v0.12