diff options
author | Gavin Howard <gavin@yzena.com> | 2021-06-27 13:01:28 -0600 |
---|---|---|
committer | Gavin Howard <gavin@yzena.com> | 2021-06-27 13:01:28 -0600 |
commit | c2d2977f2c6c9fe3cd8dc9b07fc8913008c81895 (patch) | |
tree | a58961d9a839f921da3d784466eb5b8af19ebc9f /include | |
parent | d850872ed4caa2633a0f860b27f76dc52a0f514c (diff) | |
download | platform_external_bc-c2d2977f2c6c9fe3cd8dc9b07fc8913008c81895.tar.gz platform_external_bc-c2d2977f2c6c9fe3cd8dc9b07fc8913008c81895.tar.bz2 platform_external_bc-c2d2977f2c6c9fe3cd8dc9b07fc8913008c81895.zip |
Reduce memcpy calls by pushing empty items first
This can only be used in certain situations, and is mostly useful when
the pointer is needed to initialize the item anyway. But by pushing an
empty item and returning the pointer, I can then initialize in the
vector directly instead of initialize and push (with memcpy()).
Signed-off-by: Gavin Howard <gavin@yzena.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/vector.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/vector.h b/include/vector.h index 401c3335..52398e45 100644 --- a/include/vector.h +++ b/include/vector.h @@ -69,6 +69,7 @@ void bc_vec_npopAt(BcVec *restrict v, size_t n, size_t idx); void bc_vec_push(BcVec *restrict v, const void *data); void bc_vec_npush(BcVec *restrict v, size_t n, const void *data); +void* bc_vec_pushEmpty(BcVec *restrict v); void bc_vec_pushByte(BcVec *restrict v, uchar data); void bc_vec_pushIndex(BcVec *restrict v, size_t idx); void bc_vec_string(BcVec *restrict v, size_t len, const char *restrict str); |