summaryrefslogtreecommitdiffstats
path: root/src/H5encode.h
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2023-08-25 20:56:50 (GMT)
committerGitHub <noreply@github.com>2023-08-25 20:56:50 (GMT)
commit627f7c5e026a55f176d8dfcab51633cf3b704ce6 (patch)
treeb8ef6ca645521104c25a7b5538259bb449d51c58 /src/H5encode.h
parent3dd60d914e762c6cf7d99646bc516015229176cd (diff)
downloadhdf5-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/H5encode.h')
-rw-r--r--src/H5encode.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/H5encode.h b/src/H5encode.h
index a9172ff..5be75d5 100644
--- a/src/H5encode.h
+++ b/src/H5encode.h
@@ -17,6 +17,11 @@
#ifndef H5encode_H
#define H5encode_H
+/***********/
+/* Headers */
+/***********/
+#include "H5MMprivate.h" /* Memory management */
+
/**************************/
/* Library Private Macros */
/**************************/
@@ -128,7 +133,7 @@
\
HDcompile_assert(sizeof(double) == 8); \
HDcompile_assert(sizeof(double) == sizeof(uint64_t)); \
- memcpy(&_n, &n, sizeof(double)); \
+ H5MM_memcpy(&_n, &n, sizeof(double)); \
for (_u = 0; _u < sizeof(uint64_t); _u++, _n >>= 8) \
*_p++ = (uint8_t)(_n & 0xff); \
(p) = (uint8_t *)(p) + 8; \
@@ -245,7 +250,7 @@
(p) += 8; \
for (_u = 0; _u < sizeof(uint64_t); _u++) \
_n = (_n << 8) | *(--p); \
- memcpy(&(n), &_n, sizeof(double)); \
+ H5MM_memcpy(&(n), &_n, sizeof(double)); \
(p) += 8; \
} while (0)