diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2009-10-24 19:16:06 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2009-10-24 19:16:06 (GMT) |
commit | f985e7d22f389d336894e33b84c0d60427d4ae27 (patch) | |
tree | c8faf0cc53e31982de47ff29fccb4f3cbf86f556 /src/H5HFhuge.c | |
parent | 1059b742826ca3864be8ee70c76c8ef625d31e46 (diff) | |
download | hdf5-f985e7d22f389d336894e33b84c0d60427d4ae27.zip hdf5-f985e7d22f389d336894e33b84c0d60427d4ae27.tar.gz hdf5-f985e7d22f389d336894e33b84c0d60427d4ae27.tar.bz2 |
[svn-r17740] Description:
Refactor v2 B-tree code to take creation parameters to H5B2_create() as
a struct (instead of individual arguments), call the client's class "cls"
instead of "type" internally, and add client class name to client class struct.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.1 (amazon) in debug mode
Mac OS X/32 10.6.1 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Diffstat (limited to 'src/H5HFhuge.c')
-rw-r--r-- | src/H5HFhuge.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/H5HFhuge.c b/src/H5HFhuge.c index 792a865..71a3d61 100644 --- a/src/H5HFhuge.c +++ b/src/H5HFhuge.c @@ -105,8 +105,7 @@ static herr_t H5HF_huge_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, static herr_t H5HF_huge_bt2_create(H5HF_hdr_t *hdr, hid_t dxpl_id) { - const H5B2_class_t *bt2_class; /* v2 B-tree class to use */ - size_t rrec_size; /* Size of 'raw' records on disk */ + H5B2_create_t bt2_cparam; /* v2 B-tree creation parameters */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5HF_huge_bt2_create) @@ -125,38 +124,40 @@ H5HF_huge_bt2_create(H5HF_hdr_t *hdr, hid_t dxpl_id) */ if(hdr->huge_ids_direct) { if(hdr->filter_len > 0) { - rrec_size = hdr->sizeof_addr /* Address of object */ + bt2_cparam.rrec_size = hdr->sizeof_addr /* Address of object */ + hdr->sizeof_size /* Length of object */ + 4 /* Filter mask for filtered object */ + hdr->sizeof_size; /* Size of de-filtered object in memory */ - bt2_class = H5HF_BT2_FILT_DIR; + bt2_cparam.cls = H5HF_BT2_FILT_DIR; } /* end if */ else { - rrec_size = hdr->sizeof_addr /* Address of object */ + bt2_cparam.rrec_size = hdr->sizeof_addr /* Address of object */ + hdr->sizeof_size; /* Length of object */ - bt2_class = H5HF_BT2_DIR; + bt2_cparam.cls = H5HF_BT2_DIR; } /* end else */ } /* end if */ else { - if (hdr->filter_len > 0) { - rrec_size = hdr->sizeof_addr /* Address of filtered object */ + if(hdr->filter_len > 0) { + bt2_cparam.rrec_size = hdr->sizeof_addr /* Address of filtered object */ + hdr->sizeof_size /* Length of filtered object */ + 4 /* Filter mask for filtered object */ + hdr->sizeof_size /* Size of de-filtered object in memory */ + hdr->sizeof_size; /* Unique ID for object */ - bt2_class = H5HF_BT2_FILT_INDIR; + bt2_cparam.cls = H5HF_BT2_FILT_INDIR; } /* end if */ else { - rrec_size = hdr->sizeof_addr /* Address of object */ + bt2_cparam.rrec_size = hdr->sizeof_addr /* Address of object */ + hdr->sizeof_size /* Length of object */ + hdr->sizeof_size; /* Unique ID for object */ - bt2_class = H5HF_BT2_INDIR; + bt2_cparam.cls = H5HF_BT2_INDIR; } /* end else */ } /* end else */ + bt2_cparam.node_size = (size_t)H5HF_HUGE_BT2_NODE_SIZE; + bt2_cparam.split_percent = H5HF_HUGE_BT2_SPLIT_PERC; + bt2_cparam.merge_percent = H5HF_HUGE_BT2_MERGE_PERC; /* Create v2 B-tree for tracking 'huge' objects */ - if(H5B2_create(hdr->f, dxpl_id, bt2_class, (size_t)H5HF_HUGE_BT2_NODE_SIZE, rrec_size, - H5HF_HUGE_BT2_SPLIT_PERC, H5HF_HUGE_BT2_MERGE_PERC, &hdr->huge_bt2_addr/*out*/) < 0) + if(H5B2_create(hdr->f, dxpl_id, &bt2_cparam, &hdr->huge_bt2_addr/*out*/) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCREATE, FAIL, "can't create v2 B-tree for tracking 'huge' heap objects") done: |