We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 82e6de6 commit f3fcb50Copy full SHA for f3fcb50
lib/prelude.dx
@@ -2477,8 +2477,7 @@ struct Stack(h:Heap, a|Data) =
2477
2478
def ensure_size_at_least(req_size:Nat) -> {State h} () =
2479
if req_size > self.buf_size() then
2480
- -- TODO: maybe this should use integer arithmetic?
2481
- new_buf_size = f_to_n $ 2.0 `pow` (ceil $ log2 $ n_to_f req_size)
+ new_buf_size = intpow2 (1 + natlog2 req_size)
2482
buf = self.unsafe_get_buffer()
2483
logical_size = self.size()
2484
cur_data = get $ unsafe_coerce(to=Ref(h, Fin logical_size => a), buf)
0 commit comments