aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorGavin Howard <gavin@yzena.com>2021-06-27 13:01:28 -0600
committerGavin Howard <gavin@yzena.com>2021-06-27 13:01:28 -0600
commitc2d2977f2c6c9fe3cd8dc9b07fc8913008c81895 (patch)
treea58961d9a839f921da3d784466eb5b8af19ebc9f /include
parentd850872ed4caa2633a0f860b27f76dc52a0f514c (diff)
downloadplatform_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.h1
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);