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/H5RS.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/H5RS.c')
-rw-r--r-- | src/H5RS.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -124,7 +124,7 @@ H5RS__xstrdup(H5RS_str_t *rs, const char *s) if (NULL == (rs->s = (char *)H5FL_BLK_MALLOC(str_buf, rs->max))) HGOTO_ERROR(H5E_RS, H5E_CANTALLOC, FAIL, "memory allocation failed"); if (len) - memcpy(rs->s, s, len); + H5MM_memcpy(rs->s, s, len); rs->end = rs->s + len; *rs->end = '\0'; rs->len = len; @@ -430,7 +430,7 @@ H5RS_acat(H5RS_str_t *rs, const char *s) HGOTO_ERROR(H5E_RS, H5E_CANTRESIZE, FAIL, "can't resize ref-counted string buffer"); /* Append the string */ - memcpy(rs->end, s, len); + H5MM_memcpy(rs->end, s, len); rs->end += len; *rs->end = '\0'; rs->len += len; @@ -479,7 +479,7 @@ H5RS_ancat(H5RS_str_t *rs, const char *s, size_t n) HGOTO_ERROR(H5E_RS, H5E_CANTRESIZE, FAIL, "can't resize ref-counted string buffer"); /* Append the string */ - memcpy(rs->end, s, n); + H5MM_memcpy(rs->end, s, n); rs->end += n; *rs->end = '\0'; rs->len += n; |