diff options
Diffstat (limited to 'src/H5SL.c')
-rw-r--r-- | src/H5SL.c | 43 |
1 files changed, 41 insertions, 2 deletions
@@ -549,10 +549,12 @@ H5SL_init_interface(void) /* Allocate space for array of factories */ H5SL_fac_g = (H5FL_fac_head_t **)H5MM_malloc(sizeof(H5FL_fac_head_t *)); + HDassert(H5SL_fac_g); H5SL_fac_nalloc_g = 1; /* Initialize first factory */ H5SL_fac_g[0] = H5FL_fac_init(sizeof(H5SL_node_t *)); + HDassert(H5SL_fac_g[0]); H5SL_fac_nused_g = 1; FUNC_LEAVE_NOAPI(SUCCEED) @@ -681,6 +683,10 @@ H5SL_insert_common(H5SL_t *slist, void *item, const void *key) H5SL_INSERT(OBJ, slist, prev, const H5_obj_t, key, -) break; + case H5SL_TYPE_HID: + H5SL_INSERT(SCALAR, slist, prev, const hid_t, key, -) + break; + case H5SL_TYPE_GENERIC: H5SL_INSERT(GENERIC, slist, prev, const void, key, -) break; @@ -1110,6 +1116,10 @@ H5SL_remove(H5SL_t *slist, const void *key) H5SL_REMOVE(OBJ, slist, x, const H5_obj_t, key, -) break; + case H5SL_TYPE_HID: + H5SL_REMOVE(SCALAR, slist, x, const hid_t, key, -) + break; + case H5SL_TYPE_GENERIC: H5SL_REMOVE(GENERIC, slist, x, const void, key, -) break; @@ -1293,6 +1303,10 @@ H5SL_search(H5SL_t *slist, const void *key) H5SL_SEARCH(OBJ, slist, x, const H5_obj_t, key, -) break; + case H5SL_TYPE_HID: + H5SL_SEARCH(SCALAR, slist, x, const hid_t, key, -) + break; + case H5SL_TYPE_GENERIC: H5SL_SEARCH(GENERIC, slist, x, const void, key, -) break; @@ -1382,6 +1396,10 @@ H5SL_less(H5SL_t *slist, const void *key) H5SL_SEARCH(OBJ, slist, x, const H5_obj_t, key, -) break; + case H5SL_TYPE_HID: + H5SL_SEARCH(SCALAR, slist, x, const hid_t, key, -) + break; + case H5SL_TYPE_GENERIC: H5SL_SEARCH(GENERIC, slist, x, const void, key, -) break; @@ -1484,6 +1502,10 @@ H5SL_greater(H5SL_t *slist, const void *key) H5SL_SEARCH(OBJ, slist, x, const H5_obj_t, key, -) break; + case H5SL_TYPE_HID: + H5SL_SEARCH(SCALAR, slist, x, const hid_t, key, -) + break; + case H5SL_TYPE_GENERIC: H5SL_SEARCH(GENERIC, slist, x, const void, key, -) break; @@ -1576,6 +1598,10 @@ H5SL_find(H5SL_t *slist, const void *key) H5SL_FIND(OBJ, slist, x, const H5_obj_t, key, -) break; + case H5SL_TYPE_HID: + H5SL_FIND(SCALAR, slist, x, const hid_t, key, -) + break; + case H5SL_TYPE_GENERIC: H5SL_FIND(GENERIC, slist, x, const void, key, -) break; @@ -1665,6 +1691,10 @@ H5SL_below(H5SL_t *slist, const void *key) H5SL_FIND(OBJ, slist, x, const H5_obj_t, key, -) break; + case H5SL_TYPE_HID: + H5SL_FIND(SCALAR, slist, x, const hid_t, key, -) + break; + case H5SL_TYPE_GENERIC: H5SL_FIND(GENERIC, slist, x, const void, key, -) break; @@ -1767,6 +1797,10 @@ H5SL_above(H5SL_t *slist, const void *key) H5SL_FIND(OBJ, slist, x, const H5_obj_t, key, -) break; + case H5SL_TYPE_HID: + H5SL_FIND(SCALAR, slist, x, const hid_t, key, -) + break; + case H5SL_TYPE_GENERIC: H5SL_FIND(GENERIC, slist, x, const void, key, -) break; @@ -1994,7 +2028,8 @@ H5SL_item(H5SL_node_t *slist_node) herr_t H5SL_iterate(H5SL_t *slist, H5SL_operator_t op, void *op_data) { - H5SL_node_t *node; /* Pointers to skip list nodes */ + H5SL_node_t *node; /* Pointer to current skip list node */ + H5SL_node_t *next; /* Pointer to next skip list node */ herr_t ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -2008,12 +2043,16 @@ H5SL_iterate(H5SL_t *slist, H5SL_operator_t op, void *op_data) /* Free skip list nodes */ node = slist->header->forward[0]; while(node != NULL) { + /* Protect against the node being deleted by the callback */ + next = node->forward[0]; + /* Call the iterator callback */ /* Casting away const OK -QAK */ if((ret_value = (op)(node->item, (void *)node->key, op_data)) != 0) break; - node = node->forward[0]; + /* Advance to next node */ + node = next; } /* end while */ FUNC_LEAVE_NOAPI(ret_value) |