summaryrefslogtreecommitdiffstats
path: root/src/H5FDspace.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-09-11 12:19:45 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-09-11 12:19:45 (GMT)
commitf41b8ab87bfc9702f12a3df10911960731556bed (patch)
treeb5ceafd5da2e0c1ef9ac09fcd0b0929e97e7cb62 /src/H5FDspace.c
parentf4d4d427b2f8bae72a12d4cdbee6acfc233b4c44 (diff)
downloadhdf5-f41b8ab87bfc9702f12a3df10911960731556bed.zip
hdf5-f41b8ab87bfc9702f12a3df10911960731556bed.tar.gz
hdf5-f41b8ab87bfc9702f12a3df10911960731556bed.tar.bz2
[svn-r17463] Description:
Add another regression test for userblock+alignment usage, and correct [another] issue with the combination. *sigh* 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 production mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production 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/H5FDspace.c')
-rw-r--r--src/H5FDspace.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/H5FDspace.c b/src/H5FDspace.c
index 19f9281..9895938 100644
--- a/src/H5FDspace.c
+++ b/src/H5FDspace.c
@@ -126,6 +126,7 @@ H5FD_space_init_interface(void)
static haddr_t
H5FD_extend(H5FD_t *file, H5FD_mem_t type, hbool_t new_block, hsize_t size, haddr_t *frag_addr, hsize_t *frag_size)
{
+ hsize_t orig_size = size; /* Original allocation size */
haddr_t eoa; /* Address of end-of-allocated space */
hsize_t extra; /* Extra space to allocate, to align request */
haddr_t ret_value; /* Return value */
@@ -143,7 +144,7 @@ H5FD_extend(H5FD_t *file, H5FD_mem_t type, hbool_t new_block, hsize_t size, hadd
/* Compute extra space to allocate, if this is a new block and should be aligned */
extra = 0;
- if(new_block && file->alignment > 1 && size >= file->threshold) {
+ if(new_block && file->alignment > 1 && orig_size >= file->threshold) {
hsize_t mis_align; /* Amount EOA is misaligned */
/* Check for EOA already aligned */
@@ -171,6 +172,10 @@ H5FD_extend(H5FD_t *file, H5FD_mem_t type, hbool_t new_block, hsize_t size, hadd
if(file->cls->set_eoa(file, type, eoa) < 0)
HGOTO_ERROR(H5E_VFL, H5E_NOSPACE, HADDR_UNDEF, "file allocation request failed")
+ /* Post-condition sanity check */
+ if(new_block && file->alignment && orig_size >= file->threshold)
+ HDassert(!(ret_value % file->alignment));
+
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD_extend() */