summaryrefslogtreecommitdiffstats
path: root/src/H5Sprivate.h
diff options
context:
space:
mode:
authorjhendersonHDF <jhenderson@hdfgroup.org>2024-03-10 07:47:31 (GMT)
committerGitHub <noreply@github.com>2024-03-10 07:47:31 (GMT)
commitef401a5f5edf2fc689334a485a6c2ec3f53ecb85 (patch)
tree4807deea31bdb83a5f3903f9dc3fddd48a1e0785 /src/H5Sprivate.h
parent28aaeb967ce66477441dc1f92fc45dddb51255c2 (diff)
downloadhdf5-ef401a5f5edf2fc689334a485a6c2ec3f53ecb85.zip
hdf5-ef401a5f5edf2fc689334a485a6c2ec3f53ecb85.tar.gz
hdf5-ef401a5f5edf2fc689334a485a6c2ec3f53ecb85.tar.bz2
Refactor datatype conversion code to use pointers rather than IDs (#4104)
The datatype conversion code previously used IDs for the source and destination datatypes rather than pointers to the internal structures for those datatypes. This was mostly due to the need for an ID for these datatypes that can be passed to an application-registered datatype conversion function or datatype conversion exception function. However, using IDs internally caused a lot of unnecessary ID lookups and hurt performance of datatype conversions in general. This was especially problematic for compound datatype conversions, where the ID lookups were occuring on every member of every compound element of a dataset. The code has now been refactored to use pointers internally and only create IDs for datatypes when necessary. Fixed a test issue in dt_arith where a library datatype conversion function was being cast to an application conversion function. Since the two have different prototypes, this started failing after the parameters for a library conversion function changed from hid_t to H5T_t * and an extra parameter was added. This appears to have worked coincidentally in the past since the only different between a library conversion function and application conversion function was an extra DXPL parameter at the end of an application conversion function Fixed an issue where memory wasn't being freed in the h5fc_chk_idx test program. Even though the program exits quickly after allocating the memory, it still causes failures when testing with -fsanitize=address
Diffstat (limited to 'src/H5Sprivate.h')
-rw-r--r--src/H5Sprivate.h54
1 files changed, 27 insertions, 27 deletions
diff --git a/src/H5Sprivate.h b/src/H5Sprivate.h
index 8fd73f5..b8cd20c 100644
--- a/src/H5Sprivate.h
+++ b/src/H5Sprivate.h
@@ -106,7 +106,7 @@ typedef struct H5S_sel_iter_t {
} H5S_sel_iter_t;
/* Selection iteration operator for internal library callbacks */
-typedef herr_t (*H5S_sel_iter_lib_op_t)(void *elem, const H5T_t *type, unsigned ndim, const hsize_t *point,
+typedef herr_t (*H5S_sel_iter_lib_op_t)(void *elem, H5T_t *type, unsigned ndim, const hsize_t *point,
void *op_data);
/* Describe kind of callback to make */
@@ -231,32 +231,32 @@ H5_DLL herr_t H5S_extent_copy(H5S_t *dst, const H5S_t *src);
/* Operations on selections */
H5_DLL herr_t H5S_select_deserialize(H5S_t **space, const uint8_t **p, const size_t p_size);
H5_DLL H5S_sel_type H5S_get_select_type(const H5S_t *space);
-H5_DLL herr_t H5S_select_iterate(void *buf, const H5T_t *type, H5S_t *space, const H5S_sel_iter_op_t *op,
- void *op_data);
-H5_DLL herr_t H5S_select_fill(const void *fill, size_t fill_size, H5S_t *space, void *buf);
-H5_DLL htri_t H5S_select_valid(const H5S_t *space);
-H5_DLL hsize_t H5S_get_select_npoints(const H5S_t *space);
-H5_DLL herr_t H5S_get_select_bounds(const H5S_t *space, hsize_t *start, hsize_t *end);
-H5_DLL herr_t H5S_get_select_offset(const H5S_t *space, hsize_t *offset);
-H5_DLL int H5S_get_select_unlim_dim(const H5S_t *space);
-H5_DLL herr_t H5S_get_select_num_elem_non_unlim(const H5S_t *space, hsize_t *num_elem_non_unlim);
-H5_DLL herr_t H5S_select_offset(H5S_t *space, const hssize_t *offset);
-H5_DLL herr_t H5S_select_copy(H5S_t *dst, const H5S_t *src, bool share_selection);
-H5_DLL htri_t H5S_select_shape_same(H5S_t *space1, H5S_t *space2);
-H5_DLL htri_t H5S_select_intersect_block(H5S_t *space, const hsize_t *start, const hsize_t *end);
-H5_DLL herr_t H5S_select_construct_projection(H5S_t *base_space, H5S_t **new_space_ptr,
- unsigned new_space_rank, hsize_t element_size,
- ptrdiff_t *buf_adj);
-H5_DLL herr_t H5S_select_release(H5S_t *ds);
-H5_DLL hssize_t H5S_select_serial_size(H5S_t *space);
-H5_DLL herr_t H5S_select_serialize(H5S_t *space, uint8_t **p);
-H5_DLL htri_t H5S_select_is_contiguous(const H5S_t *space);
-H5_DLL htri_t H5S_select_is_single(const H5S_t *space);
-H5_DLL htri_t H5S_select_is_regular(H5S_t *space);
-H5_DLL herr_t H5S_select_adjust_u(H5S_t *space, const hsize_t *offset);
-H5_DLL herr_t H5S_select_adjust_s(H5S_t *space, const hssize_t *offset);
-H5_DLL herr_t H5S_select_project_scalar(const H5S_t *space, hsize_t *offset);
-H5_DLL herr_t H5S_select_project_simple(const H5S_t *space, H5S_t *new_space, hsize_t *offset);
+H5_DLL herr_t H5S_select_iterate(void *buf, H5T_t *type, H5S_t *space, const H5S_sel_iter_op_t *op,
+ void *op_data);
+H5_DLL herr_t H5S_select_fill(const void *fill, size_t fill_size, H5S_t *space, void *buf);
+H5_DLL htri_t H5S_select_valid(const H5S_t *space);
+H5_DLL hsize_t H5S_get_select_npoints(const H5S_t *space);
+H5_DLL herr_t H5S_get_select_bounds(const H5S_t *space, hsize_t *start, hsize_t *end);
+H5_DLL herr_t H5S_get_select_offset(const H5S_t *space, hsize_t *offset);
+H5_DLL int H5S_get_select_unlim_dim(const H5S_t *space);
+H5_DLL herr_t H5S_get_select_num_elem_non_unlim(const H5S_t *space, hsize_t *num_elem_non_unlim);
+H5_DLL herr_t H5S_select_offset(H5S_t *space, const hssize_t *offset);
+H5_DLL herr_t H5S_select_copy(H5S_t *dst, const H5S_t *src, bool share_selection);
+H5_DLL htri_t H5S_select_shape_same(H5S_t *space1, H5S_t *space2);
+H5_DLL htri_t H5S_select_intersect_block(H5S_t *space, const hsize_t *start, const hsize_t *end);
+H5_DLL herr_t H5S_select_construct_projection(H5S_t *base_space, H5S_t **new_space_ptr,
+ unsigned new_space_rank, hsize_t element_size,
+ ptrdiff_t *buf_adj);
+H5_DLL herr_t H5S_select_release(H5S_t *ds);
+H5_DLL hssize_t H5S_select_serial_size(H5S_t *space);
+H5_DLL herr_t H5S_select_serialize(H5S_t *space, uint8_t **p);
+H5_DLL htri_t H5S_select_is_contiguous(const H5S_t *space);
+H5_DLL htri_t H5S_select_is_single(const H5S_t *space);
+H5_DLL htri_t H5S_select_is_regular(H5S_t *space);
+H5_DLL herr_t H5S_select_adjust_u(H5S_t *space, const hsize_t *offset);
+H5_DLL herr_t H5S_select_adjust_s(H5S_t *space, const hssize_t *offset);
+H5_DLL herr_t H5S_select_project_scalar(const H5S_t *space, hsize_t *offset);
+H5_DLL herr_t H5S_select_project_simple(const H5S_t *space, H5S_t *new_space, hsize_t *offset);
H5_DLL herr_t H5S_select_project_intersection(H5S_t *src_space, H5S_t *dst_space, H5S_t *src_intersect_space,
H5S_t **new_space_ptr, bool share_space);
H5_DLL herr_t H5S_select_subtract(H5S_t *space, H5S_t *subtract_space);