diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2004-07-26 04:41:52 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2004-07-26 04:41:52 (GMT) |
commit | 631e94869b7c0c4e7f053f06769b7b4550216a63 (patch) | |
tree | 79eb6b19b53c316c35845492f4c854692c221ead /src/H5Distore.c | |
parent | 881ba16bcab480daf7144c193eac356e532ac14c (diff) | |
download | hdf5-631e94869b7c0c4e7f053f06769b7b4550216a63.zip hdf5-631e94869b7c0c4e7f053f06769b7b4550216a63.tar.gz hdf5-631e94869b7c0c4e7f053f06769b7b4550216a63.tar.bz2 |
[svn-r8947] Purpose:
Code cleanup, sorta
Description:
Added ifdef sections for "H5_USING_PURIFY" in various places in the code,
which are designed to reduce the spurious "uninitialized memory read" warnings
from purify which are actually OK. Note that this macro will have to be
turned on by adding it to the CFLAGS for the build - I didn't think it was
important enough to add a configure flag for.
Also, the changes in H5HG.c optimize the walks through the objects in a
heap to only look at the 'used' entries instead of all the 'allocated' entries.
Platforms tested:
Solaris 2.7 (arabica) w/purify
Not tested by h5committest
Diffstat (limited to 'src/H5Distore.c')
-rw-r--r-- | src/H5Distore.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/H5Distore.c b/src/H5Distore.c index 209dd46..7e3c73a 100644 --- a/src/H5Distore.c +++ b/src/H5Distore.c @@ -970,6 +970,9 @@ H5D_istore_init (H5F_t *f, H5D_t *dset) assert(shared->sizeof_rnode); if(NULL==(shared->page=H5FL_BLK_MALLOC(chunk_page,shared->sizeof_rnode))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for B-tree page") +#ifdef H5_USING_PURIFY +HDmemset(shared->page,0,shared->sizeof_rnode); +#endif /* H5_USING_PURIFY */ if(NULL==(shared->nkey=H5FL_SEQ_MALLOC(size_t,(size_t)(2*H5F_KVALUE(f,H5B_ISTORE)+1)))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for B-tree page") @@ -1607,6 +1610,10 @@ H5D_istore_lock(H5F_t *f, const H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id, HDmemset (chunk, 0, chunk_size); } /* end else */ } /* end if */ +#ifdef H5_USING_PURIFY +else + HDmemset(ret_value,0,size); +#endif /* H5_USING_PURIFY */ rdcc->ninits++; } /* end else */ } @@ -2238,6 +2245,9 @@ H5D_istore_chunk_alloc(size_t size, const H5O_pline_t *pline) ret_value=H5MM_malloc(size); else ret_value=H5FL_BLK_MALLOC(chunk,size); +#ifdef H5_USING_PURIFY +HDmemset(ret_value,0,size); +#endif /* H5_USING_PURIFY */ FUNC_LEAVE_NOAPI(ret_value); } /* H5D_istore_chunk_alloc() */ |