diff options
| author | Michael Dusan <michael.dusan@gmail.com> | 2019-11-25 15:04:49 -0500 |
|---|---|---|
| committer | Michael Dusan <michael.dusan@gmail.com> | 2019-11-25 15:04:49 -0500 |
| commit | a647a88dfc6cdef66316399f10084b35f738b093 (patch) | |
| tree | 8b2ea8968a6e273bf4a7b052a8bceb0eadcab1b6 /src/bigint.cpp | |
| parent | 8f3e972da6badf6df82c88ba0c60aca7b545f62c (diff) | |
| download | zig-a647a88dfc6cdef66316399f10084b35f738b093.tar.gz zig-a647a88dfc6cdef66316399f10084b35f738b093.zip | |
const interning for 1-possible-value types
Diffstat (limited to 'src/bigint.cpp')
| -rw-r--r-- | src/bigint.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/bigint.cpp b/src/bigint.cpp index b227b3b4f7..6c74b5f64a 100644 --- a/src/bigint.cpp +++ b/src/bigint.cpp @@ -195,6 +195,11 @@ void bigint_init_bigint(BigInt *dest, const BigInt *src) { memcpy(dest->data.digits, src->data.digits, sizeof(uint64_t) * dest->digit_count); } +void bigint_deinit(BigInt *bi) { + if (bi->digit_count > 1) + deallocate<uint64_t>(bi->data.digits, bi->digit_count); +} + void bigint_init_bigfloat(BigInt *dest, const BigFloat *op) { float128_t zero; ui32_to_f128M(0, &zero); |
