diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2011-04-19 20:15:21 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2011-04-19 20:15:21 (GMT) |
commit | 099b37d073e633b0cb4d8c3f41ddf5788e63e6ee (patch) | |
tree | 3316f03ab81dbbab9160aac62fefe3f78b50c1d4 /src/H5Dint.c | |
parent | 94cf912176257c753eaddde0acabc9a11be2e48d (diff) | |
download | hdf5-099b37d073e633b0cb4d8c3f41ddf5788e63e6ee.zip hdf5-099b37d073e633b0cb4d8c3f41ddf5788e63e6ee.tar.gz hdf5-099b37d073e633b0cb4d8c3f41ddf5788e63e6ee.tar.bz2 |
[svn-r20559] Description:
Bring r20407:20557 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/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) 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, w/threadsafe, in production mode
Linux/PPC 2.6 (heiwa) w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-ia64 2.6 (ember) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode
Diffstat (limited to 'src/H5Dint.c')
-rw-r--r-- | src/H5Dint.c | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/src/H5Dint.c b/src/H5Dint.c index f3e0b3c..a4f5c8d 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -1750,16 +1750,23 @@ H5D_alloc_storage(H5D_t *dset/*in,out*/, hid_t dxpl_id, H5D_time_alloc_t time_al case H5D_COMPACT: /* Check if space is already allocated */ if(NULL == layout->storage.u.compact.buf) { - /* Reserve space in layout header message for the entire array. */ - HDassert(layout->storage.u.compact.size > 0); - if(NULL == (layout->storage.u.compact.buf = H5MM_malloc(layout->storage.u.compact.size))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate memory for compact dataset") - if(!full_overwrite) - HDmemset(layout->storage.u.compact.buf, 0, layout->storage.u.compact.size); - layout->storage.u.compact.dirty = TRUE; - - /* Indicate that we should initialize storage space */ - must_init_space = TRUE; + /* Reserve space in layout header message for the entire array. + * Starting from the 1.8.7 release, we allow dataspace to have + * zero dimension size. So the storage size can be zero. + * SLU 2011/4/4 */ + if(layout->storage.u.compact.size > 0) { + if(NULL == (layout->storage.u.compact.buf = H5MM_malloc(layout->storage.u.compact.size))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate memory for compact dataset") + if(!full_overwrite) + HDmemset(layout->storage.u.compact.buf, 0, layout->storage.u.compact.size); + layout->storage.u.compact.dirty = TRUE; + + /* Indicate that we should initialize storage space */ + must_init_space = TRUE; + } else { + layout->storage.u.compact.dirty = FALSE; + must_init_space = FALSE; + } } /* end if */ break; |