diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2023-08-25 20:56:50 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-25 20:56:50 (GMT) |
commit | 627f7c5e026a55f176d8dfcab51633cf3b704ce6 (patch) | |
tree | b8ef6ca645521104c25a7b5538259bb449d51c58 /src/H5FDonion.c | |
parent | 3dd60d914e762c6cf7d99646bc516015229176cd (diff) | |
download | hdf5-627f7c5e026a55f176d8dfcab51633cf3b704ce6.zip hdf5-627f7c5e026a55f176d8dfcab51633cf3b704ce6.tar.gz hdf5-627f7c5e026a55f176d8dfcab51633cf3b704ce6.tar.bz2 |
Convert some H5MM calls to standard C equivalents (#2382)
* H5MM_calloc and malloc are now mapped to stdlib C calls
* H5MM_memcpy now maps directly to memcpy in release builds
* H5MM_memcpy is still implemented as a separate function that
checks for buffer overlap when H5MM_DEBUG is defined
(default w/ debug builds)
* Switches many library memcpy calls to use H5MM_memcpy
* Fixes a possible zero allocation in H5Olayout.c
Diffstat (limited to 'src/H5FDonion.c')
-rw-r--r-- | src/H5FDonion.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/H5FDonion.c b/src/H5FDonion.c index dcec221..a9d11e0 100644 --- a/src/H5FDonion.c +++ b/src/H5FDonion.c @@ -295,7 +295,7 @@ H5Pget_fapl_onion(hid_t fapl_id, H5FD_onion_fapl_info_t *fa_out) if (NULL == (info_ptr = (const H5FD_onion_fapl_info_t *)H5P_peek_driver_info(plist))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad VFL driver info"); - memcpy(fa_out, info_ptr, sizeof(H5FD_onion_fapl_info_t)); + H5MM_memcpy(fa_out, info_ptr, sizeof(H5FD_onion_fapl_info_t)); done: FUNC_LEAVE_API(ret_value) @@ -514,7 +514,7 @@ H5FD__onion_commit_new_revision_record(H5FD_onion_t *file) if (NULL == (new_list = H5MM_calloc((history->n_revisions + 1) * sizeof(H5FD_onion_record_loc_t)))) HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "unable to resize record pointer list"); - memcpy(new_list, history->record_locs, sizeof(H5FD_onion_record_loc_t) * history->n_revisions); + H5MM_memcpy(new_list, history->record_locs, sizeof(H5FD_onion_record_loc_t) * history->n_revisions); H5MM_xfree(history->record_locs); history->record_locs = new_list; new_list = NULL; @@ -980,7 +980,7 @@ H5FD__onion_open(const char *filename, unsigned flags, hid_t fapl_id, haddr_t ma /* Initialize file structure fields */ - memcpy(&(file->fa), fa, sizeof(H5FD_onion_fapl_info_t)); + H5MM_memcpy(&(file->fa), fa, sizeof(H5FD_onion_fapl_info_t)); file->header.version = H5FD_ONION_HEADER_VERSION_CURR; file->header.page_size = file->fa.page_size; /* guarded on FAPL-set */ @@ -1523,7 +1523,7 @@ H5FD__onion_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, if (H5FD_read(file->onion_file, H5FD_MEM_DRAW, entry_out->phys_addr, page_size, page_buf) < 0) HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "can't get working file data"); /* Overlay delta from input buffer onto page buffer. */ - memcpy(page_buf + page_gap_head, buf, page_n_used); + H5MM_memcpy(page_buf + page_gap_head, buf, page_n_used); write_buf = page_buf; } /* end if partial page */ @@ -1571,7 +1571,7 @@ H5FD__onion_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, /* Copy input buffer to temporary page buffer */ assert((page_size - page_gap_head) >= page_n_used); - memcpy(page_buf + page_gap_head, buf, page_n_used); + H5MM_memcpy(page_buf + page_gap_head, buf, page_n_used); write_buf = page_buf; } /* end if data range does not span entire page */ |