diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2007-01-08 23:29:49 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2007-01-08 23:29:49 (GMT) |
commit | 2104bd1e0a85c01a871910803883637f48ac2573 (patch) | |
tree | 7eb3f70b5981be590582805aac655929b941eeaf /src | |
parent | d978a22b36d148a17f331eb51d0e13ede524770a (diff) | |
download | hdf5-2104bd1e0a85c01a871910803883637f48ac2573.zip hdf5-2104bd1e0a85c01a871910803883637f48ac2573.tar.gz hdf5-2104bd1e0a85c01a871910803883637f48ac2573.tar.bz2 |
[svn-r13122] Description:
Add more tests for attributes with shared components.
Close memory leak in shared message table loading.
Tested on:
Linux/32 2.6 (chicago)
Linux/64 2.6 (chicago2)
Diffstat (limited to 'src')
-rw-r--r-- | src/H5A.c | 4 | ||||
-rw-r--r-- | src/H5SMcache.c | 9 |
2 files changed, 8 insertions, 5 deletions
@@ -365,11 +365,11 @@ H5A_create(const H5G_loc_t *loc, const char *name, const H5T_t *type, /* Check if any of the pieces should be (or are already) shared in the * SOHM table */ /* Data type */ - if(H5SM_try_share(attr->oloc.file, dxpl_id, H5O_DTYPE_ID, attr->dt) <0) + if(H5SM_try_share(attr->oloc.file, dxpl_id, H5O_DTYPE_ID, attr->dt) < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADMESG, FAIL, "trying to share datatype failed") /* Data space */ - if(H5SM_try_share(attr->oloc.file, dxpl_id, H5O_SDSPACE_ID, attr->ds) <0) + if(H5SM_try_share(attr->oloc.file, dxpl_id, H5O_SDSPACE_ID, attr->ds) < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADMESG, FAIL, "trying to share dataspace failed") diff --git a/src/H5SMcache.c b/src/H5SMcache.c index 5e8f58f..70f6177 100644 --- a/src/H5SMcache.c +++ b/src/H5SMcache.c @@ -122,7 +122,7 @@ H5SM_flush_table(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5SM_ma HDassert(H5F_addr_defined(addr)); HDassert(table); - if (table->cache_info.is_dirty) { + if(table->cache_info.is_dirty) { uint8_t *buf; /* Temporary buffer */ uint8_t *p; /* Pointer into raw data buffer */ size_t size; /* Header size on disk */ @@ -133,7 +133,7 @@ H5SM_flush_table(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5SM_ma size = H5SM_TABLE_SIZE(f) + (H5SM_INDEX_HEADER_SIZE(f) * table->num_indexes); /* Allocate the buffer */ /* JAMES: use H5FL_BLK_MALLOC instead? */ - if(NULL == (buf = HDmalloc(size))) + if(NULL == (buf = H5MM_malloc(size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") /* Encode the master table */ @@ -168,7 +168,10 @@ H5SM_flush_table(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5SM_ma HGOTO_ERROR(H5E_SOHM, H5E_CANTFLUSH, FAIL, "unable to save sohm table to disk") table->cache_info.is_dirty = FALSE; - } + + /* Free buffer */ + H5MM_xfree(buf); + } /* end if */ if(destroy) if(H5SM_dest_table(f, table) < 0) |