make capacity be the power of 2
Closed this issue · 1 comments
github-actions commented
make capacity be the power of 2
Line 76 in 6519bc6
}
void value_array_init_with_values(struct value_array* arr, int len,
const struct hg_value* values) {
arr->len = len;
arr->capacity = len; // TODO: make capacity be the power of 2
arr->values = array_alloc_(struct hg_value, len);
memcpy(arr->values, values, len * sizeof(struct hg_value));
}
void value_array_free(struct value_array* arr) {
array_free_(arr->values, struct hg_value, arr->capacity);
ndex 66fe506..746c3f5 100644
++ b/src/value.h
e328efb8e9c5be82f3f2fa681c800092979c11a4
github-actions commented
Closed in 1a3721b