Removed all allocs from Hypercore's proof code. The API is now madness though; wonder how we could do better. https://github.com/datrs/tree-index/commit/4c60b941eecc9a80ed90fede1fe691787d23eb7c …
-
-
Replying to @yoshuawuyts
so sorry to tell you this but `Vec::push` as well as `format!` can alloc
1 reply 0 retweets 1 like -
Replying to @killercup
ahaha, no no - that's good. Was hoping someone would reply. The purpose of this would be that the person calling this method is responsible, and allocates a large enough vector up front. That way memory usage can stay stable between calls - and save CPU cycles.
1 reply 0 retweets 0 likes -
Replying to @yoshuawuyts @killercup
Because if my_vec.capacity() is large enough, it shouldn't allocate, right?
1 reply 0 retweets 0 likes -
Replying to @yoshuawuyts
true -- which you might want to explicitly document somewhere if you haven't already? :) the format you can probably just omit, not sure how valuable that error message is. otoh, it's a cold path in a `panic!`
1 reply 0 retweets 1 like
ahhh, yes fair! All v. good points :D
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.