diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2000-09-20 19:26:18 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2000-09-20 19:26:18 (GMT) |
commit | 88f539bf15487193bbe1cfbd41436bd49b2ea963 (patch) | |
tree | 900e1c067b8ecd5a571fe4c702b8ff7f2ff8e0ac /src | |
parent | 53513a5ad28c42fbd4110f0bd3247278ff8f05a1 (diff) | |
download | hdf5-88f539bf15487193bbe1cfbd41436bd49b2ea963.zip hdf5-88f539bf15487193bbe1cfbd41436bd49b2ea963.tar.gz hdf5-88f539bf15487193bbe1cfbd41436bd49b2ea963.tar.bz2 |
[svn-r2583] Purpose:
Bug Fix.
Description:
An assertion in the local heap code was mistakenly checking against too
large of a value for the size of new local heap created. When used with
larger-sized (>10KB) variable-length objects, it was failing the check.
Solution:
Corrected to check against the actual size of the heap allocated, without
the heap header.
Platforms tested:
FreeBSD 4.1
Diffstat (limited to 'src')
-rw-r--r-- | src/H5HG.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -117,6 +117,9 @@ H5HG_create (H5F_t *f, size_t size) assert (f); if (size<H5HG_MINSIZE) size = H5HG_MINSIZE; size = H5HG_ALIGN(size); +#ifdef QAK +printf("%s: size=%d\n",FUNC,(int)size); +#endif /* QAK */ /* Create it */ if (HADDR_UNDEF==(addr=H5MF_alloc(f, H5FD_MEM_GHEAP, (hsize_t)size))) { @@ -160,6 +163,9 @@ H5HG_create (H5F_t *f, size_t size) /* The freespace object */ heap->obj[0].size = size - H5HG_SIZEOF_HDR(f); +#ifdef QAK +printf("%s: heap->obj[0].size=%d, size=%d\n",FUNC,(int)heap->obj[0].size,(int)size); +#endif /* QAK */ assert(H5HG_ISALIGNED(heap->obj[0].size)); heap->obj[0].begin = p; UINT16ENCODE(p, 0); /*object ID*/ @@ -601,7 +607,14 @@ H5HG_insert (H5F_t *f, size_t size, void *obj, H5HG_t *hobj/*out*/) } assert (f->shared->ncwfs>0); assert (f->shared->cwfs[0]==heap); +#ifdef QAK +printf("%s: f->shared->cwfs[0]->obj[0].size=%d, size=%d, need=%d, H5HG_SIZEOF_HDR(f)=%d\n",FUNC,(int)f->shared->cwfs[0]->obj[0].size,(int)size,(int)need,(int)H5HG_SIZEOF_HDR(f)); +#endif /* QAK */ +#ifdef OLD_WAY assert (f->shared->cwfs[0]->obj[0].size >= need+H5HG_SIZEOF_HDR(f)); +#else /* OLD_WAY */ + assert (f->shared->cwfs[0]->obj[0].size >= need); +#endif /* OLD_WAY */ cwfsno = 0; } |