diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2009-10-24 19:50:51 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2009-10-24 19:50:51 (GMT) |
commit | 5345a51120d9fcf05b91252544a914352b91065f (patch) | |
tree | b4316dcd641556fc2349b002d7f226773bb34000 /src/H5Adense.c | |
parent | 7a68924d3b81cf8b3e6e421294270abc933b44a9 (diff) | |
download | hdf5-5345a51120d9fcf05b91252544a914352b91065f.zip hdf5-5345a51120d9fcf05b91252544a914352b91065f.tar.gz hdf5-5345a51120d9fcf05b91252544a914352b91065f.tar.bz2 |
[svn-r17741] Description:
Bring r17740 from trunk to 1.8 branch:
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/H5Adense.c')
-rw-r--r-- | src/H5Adense.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/H5Adense.c b/src/H5Adense.c index bc5ddfb..ccc4e0f 100644 --- a/src/H5Adense.c +++ b/src/H5Adense.c @@ -186,8 +186,8 @@ herr_t H5A_dense_create(H5F_t *f, hid_t dxpl_id, H5O_ainfo_t *ainfo) { H5HF_create_t fheap_cparam; /* Fractal heap creation parameters */ + H5B2_create_t bt2_cparam; /* v2 B-tree creation parameters */ H5HF_t *fheap; /* Fractal heap handle */ - size_t bt2_rrec_size; /* v2 B-tree raw record size */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5A_dense_create, FAIL) @@ -239,14 +239,15 @@ HDfprintf(stderr, "%s: fheap_id_len = %Zu\n", FUNC, fheap_id_len); HGOTO_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close fractal heap") /* Create the name index v2 B-tree */ - bt2_rrec_size = 4 + /* Name's hash value */ + bt2_cparam.cls = H5A_BT2_NAME; + bt2_cparam.node_size = (size_t)H5A_NAME_BT2_NODE_SIZE; + bt2_cparam.rrec_size = 4 + /* Name's hash value */ 4 + /* Creation order index */ 1 + /* Message flags */ H5O_FHEAP_ID_LEN; /* Fractal heap ID */ - if(H5B2_create(f, dxpl_id, H5A_BT2_NAME, - (size_t)H5A_NAME_BT2_NODE_SIZE, bt2_rrec_size, - H5A_NAME_BT2_SPLIT_PERC, H5A_NAME_BT2_MERGE_PERC, - &ainfo->name_bt2_addr) < 0) + bt2_cparam.split_percent = H5A_NAME_BT2_SPLIT_PERC; + bt2_cparam.merge_percent = H5A_NAME_BT2_MERGE_PERC; + if(H5B2_create(f, dxpl_id, &bt2_cparam, &ainfo->name_bt2_addr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to create v2 B-tree for name index") #ifdef QAK HDfprintf(stderr, "%s: ainfo->name_bt2_addr = %a\n", FUNC, ainfo->name_bt2_addr); @@ -255,13 +256,14 @@ HDfprintf(stderr, "%s: ainfo->name_bt2_addr = %a\n", FUNC, ainfo->name_bt2_addr) /* Check if we should create a creation order index v2 B-tree */ if(ainfo->index_corder) { /* Create the creation order index v2 B-tree */ - bt2_rrec_size = 4 + /* Creation order index */ + bt2_cparam.cls = H5A_BT2_CORDER; + bt2_cparam.node_size = (size_t)H5A_CORDER_BT2_NODE_SIZE; + bt2_cparam.rrec_size = 4 + /* Creation order index */ 1 + /* Message flags */ H5O_FHEAP_ID_LEN; /* Fractal heap ID */ - if(H5B2_create(f, dxpl_id, H5A_BT2_CORDER, - (size_t)H5A_CORDER_BT2_NODE_SIZE, bt2_rrec_size, - H5A_CORDER_BT2_SPLIT_PERC, H5A_CORDER_BT2_MERGE_PERC, - &ainfo->corder_bt2_addr) < 0) + bt2_cparam.split_percent = H5A_CORDER_BT2_SPLIT_PERC; + bt2_cparam.merge_percent = H5A_CORDER_BT2_MERGE_PERC; + if(H5B2_create(f, dxpl_id, &bt2_cparam, &ainfo->corder_bt2_addr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to create v2 B-tree for name index") #ifdef QAK HDfprintf(stderr, "%s: ainfo->corder_bt2_addr = %a\n", FUNC, ainfo->corder_bt2_addr); |