summaryrefslogtreecommitdiffstats
path: root/test/cache_common.c
diff options
context:
space:
mode:
authorJohn Mainzer <mainzer@hdfgroup.org>2006-08-17 22:04:47 (GMT)
committerJohn Mainzer <mainzer@hdfgroup.org>2006-08-17 22:04:47 (GMT)
commite8c1fdd5545240b47ea996be3db3fa9e27fb42a0 (patch)
tree715a78198ed2ff12fad19582b2c74288a14965e6 /test/cache_common.c
parentdb9759bd104901576af5cc821aba2c283a3319ec (diff)
downloadhdf5-e8c1fdd5545240b47ea996be3db3fa9e27fb42a0.zip
hdf5-e8c1fdd5545240b47ea996be3db3fa9e27fb42a0.tar.gz
hdf5-e8c1fdd5545240b47ea996be3db3fa9e27fb42a0.tar.bz2
[svn-r12595] Modified H5C_insert_entry() to accept the H5C__PIN_ENTRY_FLAG entry
flag, and pin an entry as it is inserted. The objective is to avoid some function call overhead in fheap. Also added matching test code in test/cache.c & test/cache_common.c (also testpar/t_cache.c checked in separately by accident) h5commit tested
Diffstat (limited to 'test/cache_common.c')
-rw-r--r--test/cache_common.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/cache_common.c b/test/cache_common.c
index 7e04d37..a9a3f55 100644
--- a/test/cache_common.c
+++ b/test/cache_common.c
@@ -1600,6 +1600,10 @@ flush_cache(H5C_t * cache_ptr,
* Added code to initialize the new cache_ptr field of the
* test_entry_t structure.
*
+ * JRM -- 8/10/06
+ * Updated to reflect the fact that entries can now be
+ * inserted pinned.
+ *
*-------------------------------------------------------------------------
*/
@@ -1611,6 +1615,7 @@ insert_entry(H5C_t * cache_ptr,
unsigned int flags)
{
herr_t result;
+ hbool_t insert_pinned;
test_entry_t * base_addr;
test_entry_t * entry_ptr;
@@ -1628,6 +1633,8 @@ insert_entry(H5C_t * cache_ptr,
HDassert( entry_ptr == entry_ptr->self );
HDassert( !(entry_ptr->is_protected) );
+ insert_pinned = ((flags & H5C__PIN_ENTRY_FLAG) != 0 );
+
entry_ptr->is_dirty = TRUE;
result = H5C_insert_entry(NULL, -1, -1, cache_ptr, &(types[type]),
@@ -1663,6 +1670,17 @@ insert_entry(H5C_t * cache_ptr,
entry_ptr->cache_ptr = cache_ptr;
+ if ( insert_pinned ) {
+
+ HDassert( entry_ptr->header.is_pinned );
+ entry_ptr->is_pinned = TRUE;
+
+ } else {
+
+ HDassert( ! ( entry_ptr->header.is_pinned ) );
+ entry_ptr->is_pinned = FALSE;
+
+ }
HDassert( entry_ptr->header.is_dirty );
HDassert( ((entry_ptr->header).type)->id == type );
}