Fix some incorrect buffer sizes in the memory manager#2826
Fix some incorrect buffer sizes in the memory manager#2826stevenengler merged 1 commit intoshadow:mainfrom
Conversation
sporksmith
left a comment
There was a problem hiding this comment.
Good catch!
Maybe we ought to add a method like byte_count?
Similarly I'm a little tempted to rename len to something like item_count. I think I originally used len to parallel the slice API, but in practice it's relatively common to want the length in bytes, and apparently easy to forget that len isn't that, at least for me :)
One fix is in a log statement, and the other is in `AllocdMem` which we only ever use as a `AllocdMem<u8>`, so neither of these currently cause incorrect behaviour.
bdd4cad to
d53376d
Compare
I think these would sound good to me. It's nice to follow the slice API, but yeah if it makes the code clearer then I think renaming them makes sense. |
One fix is in a log statement, and the other is in
AllocdMemwhich we only ever use as anAllocdMem<u8>, so neither of these currently cause incorrect behaviour.