summaryrefslogtreecommitdiffstats
path: root/src/H5MF.c
diff options
context:
space:
mode:
authorJames Laird <jlaird@hdfgroup.org>2006-09-28 19:36:25 (GMT)
committerJames Laird <jlaird@hdfgroup.org>2006-09-28 19:36:25 (GMT)
commit71ba8671b3c48722c09fed8721e73b9322d14a5c (patch)
treebce6912afc6d7b4933d141b751175177b6ade45a /src/H5MF.c
parent3289dc5a18474cfe39211cb006d01a84a4f0a27c (diff)
downloadhdf5-71ba8671b3c48722c09fed8721e73b9322d14a5c.zip
hdf5-71ba8671b3c48722c09fed8721e73b9322d14a5c.tar.gz
hdf5-71ba8671b3c48722c09fed8721e73b9322d14a5c.tar.bz2
[svn-r12692] Removed code that was used to support lazy allocation of file space
since HDF5 no longer allocates file space lazily. Tested on mir; should be only a cleanup, since the code isn't called from anywhere.
Diffstat (limited to 'src/H5MF.c')
-rw-r--r--src/H5MF.c87
1 files changed, 2 insertions, 85 deletions
diff --git a/src/H5MF.c b/src/H5MF.c
index 6f68027..9fe00b4 100644
--- a/src/H5MF.c
+++ b/src/H5MF.c
@@ -215,81 +215,6 @@ done:
}
/*-------------------------------------------------------------------------
- * Function: H5MF_reserve
- *
- * Purpose: Sets aside file space that has not yet been allocated, but will
- * be (or might be in the worst case). This number is used to
- * ensure that there is room in the file when it is flushed to disk.
- *
- * Nothing changes (and no error is generated) if the file is opened
- * as read-only.
- *
- * Return: Success: 0
- *
- * Failure: negative
- *
- * Programmer: James Laird
- * Nat Furrer
- * Thursday, May 27, 2004
- *
- * Modifications:
- *-------------------------------------------------------------------------
- */
-herr_t
-H5MF_reserve(H5F_t *f, hsize_t size)
-{
- herr_t ret_value = SUCCEED;
-
- FUNC_ENTER_NOAPI(H5MF_reserve, FAIL);
-
- /* Check arguments */
- assert(f);
-
- /* Check that there is room in the file to reserve this space */
- if( H5MF_alloc_overflow( f, size ) )
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "not enough address space in file");
-
- f->shared->lf->reserved_alloc += size;
-
-done:
- FUNC_LEAVE_NOAPI(ret_value);
-}
-
-/*-------------------------------------------------------------------------
- * Function: H5MF_free_reserved
- *
- * Purpose: Releases the file space set aside by H5MF_reserve. This should
- * be called immediately before allocating the file space for which
- * the space was reserved.
- *
- * Return: None
- *
- * Programmer: James Laird
- * Nat Furrer
- * Thursday, May 27, 2004
- *
- * Modifications:
- *-------------------------------------------------------------------------
- */
-herr_t
-H5MF_free_reserved(H5F_t *f, hsize_t size)
-{
- FUNC_ENTER_NOAPI_NOFUNC(H5MF_free_reserved)
-
- /* Check arguments */
- assert(f);
-
- /* If this assert breaks, it means that HDF5 is trying to free file space
- * that was never reserved.
- */
- assert(size <= f->shared->lf->reserved_alloc);
-
- f->shared->lf->reserved_alloc -= size;
-
- FUNC_LEAVE_NOAPI(SUCCEED)
-}
-
-/*-------------------------------------------------------------------------
* Function: H5MF_alloc_overflow
*
* Purpose: Checks if an allocation of file space would cause an overflow.
@@ -329,19 +254,11 @@ H5MF_alloc_overflow(H5F_t *f, hsize_t size)
/* Add the amount of space requested for this allocation */
space_needed += size;
- /* Also add space that is "reserved" for data to be flushed
- * to disk (e.g., for object headers and the heap).
- * This is the total amount of file space that will be
- * allocated.
- */
- space_needed += f->shared->lf->reserved_alloc;
-
/* Ensure that this final number is less than the file's
* address space. We do this by shifting in multiples
* of 16 bits because some systems will do nothing if
- * we shift by the size of a long long (64 bits) all at
- * once (<cough> Linux <cough>). Thus, we break one shift
- * into several smaller shifts.
+ * we shift by 64 bits all at once (<cough> Linux <cough>).
+ * Thus, we break one shift into several smaller shifts.
*/
for(c=0; c < H5F_SIZEOF_ADDR(f); c += 2)
space_needed = space_needed >> 16;