summaryrefslogtreecommitdiffstats
path: root/src/H5HG.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-06-08 03:06:56 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-06-08 03:06:56 (GMT)
commit15dbc76104b87ff2aa748e73633cfe87270e3807 (patch)
treec38415945dcd3c5d76585435347d365d4f38f3a1 /src/H5HG.c
parentccea4bb7b5644666d0cb70b4d5c35a12fc133d59 (diff)
downloadhdf5-15dbc76104b87ff2aa748e73633cfe87270e3807.zip
hdf5-15dbc76104b87ff2aa748e73633cfe87270e3807.tar.gz
hdf5-15dbc76104b87ff2aa748e73633cfe87270e3807.tar.bz2
[svn-r13842] Description:
Fix compact dataset storage to initialize VL datatype fill values correctly. Also, fix bug in global heap code when the fix action on a global heap is to delete an object in a heap with no free space. Tested on: Mac OS X/32 10.4.9 (amazon) FreeBSD/32 6.2 (duty)
Diffstat (limited to 'src/H5HG.c')
-rw-r--r--src/H5HG.c38
1 files changed, 18 insertions, 20 deletions
diff --git a/src/H5HG.c b/src/H5HG.c
index a4cb233..4ee63d1 100644
--- a/src/H5HG.c
+++ b/src/H5HG.c
@@ -456,26 +456,24 @@ H5HG_load (H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED * udata1,
* necessary to make room. We remove the right-most entry that has less
* free space than this heap.
*/
- if (heap->obj[0].size>0) {
- if (!f->shared->cwfs) {
- f->shared->cwfs = H5MM_malloc (H5HG_NCWFS*sizeof(H5HG_heap_t*));
- if (NULL==f->shared->cwfs)
- HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed");
- f->shared->ncwfs = 1;
- f->shared->cwfs[0] = heap;
- } else if (H5HG_NCWFS==f->shared->ncwfs) {
- for (i=H5HG_NCWFS-1; i>=0; --i) {
- if (f->shared->cwfs[i]->obj[0].size < heap->obj[0].size) {
- HDmemmove (f->shared->cwfs+1, f->shared->cwfs, i * sizeof(H5HG_heap_t*));
- f->shared->cwfs[0] = heap;
- break;
- }
- }
- } else {
- HDmemmove (f->shared->cwfs+1, f->shared->cwfs, f->shared->ncwfs*sizeof(H5HG_heap_t*));
- f->shared->ncwfs += 1;
- f->shared->cwfs[0] = heap;
- }
+ if (!f->shared->cwfs) {
+ f->shared->cwfs = H5MM_malloc (H5HG_NCWFS*sizeof(H5HG_heap_t*));
+ if (NULL==f->shared->cwfs)
+ HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed");
+ f->shared->ncwfs = 1;
+ f->shared->cwfs[0] = heap;
+ } else if (H5HG_NCWFS==f->shared->ncwfs) {
+ for (i=H5HG_NCWFS-1; i>=0; --i) {
+ if (f->shared->cwfs[i]->obj[0].size < heap->obj[0].size) {
+ HDmemmove (f->shared->cwfs+1, f->shared->cwfs, i * sizeof(H5HG_heap_t*));
+ f->shared->cwfs[0] = heap;
+ break;
+ }
+ }
+ } else {
+ HDmemmove (f->shared->cwfs+1, f->shared->cwfs, f->shared->ncwfs*sizeof(H5HG_heap_t*));
+ f->shared->ncwfs += 1;
+ f->shared->cwfs[0] = heap;
}
ret_value = heap;