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_history.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_history.c')
-rw-r--r-- | src/H5FDonion_history.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/H5FDonion_history.c b/src/H5FDonion_history.c index e559e80..875d638 100644 --- a/src/H5FDonion_history.c +++ b/src/H5FDonion_history.c @@ -180,7 +180,7 @@ H5FD__onion_history_decode(unsigned char *buf, H5FD_onion_history_t *history) ptr = buf + 8; - memcpy(&ui64, ptr, 8); + H5MM_memcpy(&ui64, ptr, 8); ui8p = (uint8_t *)&ui64; UINT64DECODE(ui8p, n_revisions); ptr += 8; @@ -207,19 +207,19 @@ H5FD__onion_history_decode(unsigned char *buf, H5FD_onion_history_t *history) uint64_t record_size; uint64_t phys_addr; - memcpy(&ui64, ptr, 8); + H5MM_memcpy(&ui64, ptr, 8); ui8p = (uint8_t *)&ui64; UINT64DECODE(ui8p, phys_addr); H5_CHECKED_ASSIGN(rloc->phys_addr, haddr_t, phys_addr, uint64_t); ptr += 8; - memcpy(&ui64, ptr, 8); + H5MM_memcpy(&ui64, ptr, 8); ui8p = (uint8_t *)&ui64; UINT64DECODE(ui8p, record_size); H5_CHECKED_ASSIGN(rloc->record_size, hsize_t, record_size, uint64_t); ptr += 8; - memcpy(&ui32, ptr, 4); + H5MM_memcpy(&ui32, ptr, 4); ui8p = (uint8_t *)&ui32; UINT32DECODE(ui8p, rloc->checksum); ptr += 4; @@ -228,7 +228,7 @@ H5FD__onion_history_decode(unsigned char *buf, H5FD_onion_history_t *history) sum = H5_checksum_fletcher32(buf, (size_t)(ptr - buf)); - memcpy(&ui32, ptr, 4); + H5MM_memcpy(&ui32, ptr, 4); ui8p = (uint8_t *)&ui32; UINT32DECODE(ui8p, history->checksum); ptr += 4; @@ -275,7 +275,7 @@ H5FD__onion_history_encode(H5FD_onion_history_t *history, unsigned char *buf, ui assert(buf != NULL); assert(checksum != NULL); - memcpy(ptr, H5FD_ONION_HISTORY_SIGNATURE, 4); + H5MM_memcpy(ptr, H5FD_ONION_HISTORY_SIGNATURE, 4); ptr += 4; UINT32ENCODE(ptr, vers_u32); UINT64ENCODE(ptr, history->n_revisions); |