diff options
author | Aryadev Chavali <aryadev@aryadevchavali.com> | 2023-11-01 17:25:33 +0000 |
---|---|---|
committer | Aryadev Chavali <aryadev@aryadevchavali.com> | 2023-11-01 17:25:33 +0000 |
commit | 89fd2b0d17da72aec688946e89eeae4bf196e419 (patch) | |
tree | f7890cd9e713809006e5f4cad97fdae79d6b10ed /lib | |
parent | 0bab4ec014777aa8e409de93ff7d8d4e8fcf490d (diff) | |
download | ovm-89fd2b0d17da72aec688946e89eeae4bf196e419.tar.gz ovm-89fd2b0d17da72aec688946e89eeae4bf196e419.tar.bz2 ovm-89fd2b0d17da72aec688946e89eeae4bf196e419.zip |
Set any new data allocated to 0 for clarity
This is only new data allocated, so it's a very careful procedure.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/darr.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -34,6 +34,7 @@ void darr_ensure_capacity(darr_t *darr, size_t requested) darr->available = MAX(darr->used + requested, darr->available * DARR_REALLOC_MULT); darr->data = realloc(darr->data, darr->available); + memset(darr->data + darr->used, 0, darr->available - darr->used); } } |