From 88f539bf15487193bbe1cfbd41436bd49b2ea963 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Wed, 20 Sep 2000 14:26:18 -0500 Subject: [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 --- src/H5HG.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/H5HG.c b/src/H5HG.c index 27e62f2..94a340a 100644 --- a/src/H5HG.c +++ b/src/H5HG.c @@ -117,6 +117,9 @@ H5HG_create (H5F_t *f, size_t size) assert (f); if (sizeobj[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; } -- cgit v0.12