Commit d50da15
committed
Fix heap over-allocation in calculate_heap_usage
Function was using num_bytes in SMALL_BIG_EXT case when estimating heap
consumption: the correct input is roughly `num_bytes / sizeof(digit) +
align_padding`.
Also add `intn_required_digits_for_unsigned_integer` for this purpose to
intn.h.
This change required newly introduced `size_align_up_pow2` in utils.h.
Signed-off-by: Davide Bettio <davide@uninstall.it>1 parent fb09706 commit d50da15
2 files changed
+7
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1011 | 1011 | | |
1012 | 1012 | | |
1013 | 1013 | | |
| 1014 | + | |
1014 | 1015 | | |
1015 | 1016 | | |
1016 | | - | |
| 1017 | + | |
1017 | 1018 | | |
1018 | 1019 | | |
1019 | 1020 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
163 | 168 | | |
164 | 169 | | |
165 | 170 | | |
| |||
0 commit comments