You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IIUC, allocpromises to allocate AT LEAST size bytes.
To do that, the number of pages would need to be rounded UP. Whereas, the current code rounds DOWN. For example, the code could instead say this:
let pages = size.div_ceil(self.page_size());
(Ofc, the behavior is the same when size HAPPENS TO BE divisible by page_size.)
Am I missing something? If I'm right, seems like someone would have HAD to have noticed this by now. Unless everyone is always passing a size that is divisible by self.page_size(), anyone who is relying on the "at least size" guarantee would have been "short changed", which I imagine would very often cause unrecoverable problems...
The text was updated successfully, but these errors were encountered:
Specifically, here in wasm.rs, it says
IIUC,
alloc
promises to allocate AT LEASTsize
bytes.To do that, the number of pages would need to be rounded UP. Whereas, the current code rounds DOWN. For example, the code could instead say this:
(Ofc, the behavior is the same when
size
HAPPENS TO BE divisible bypage_size
.)Am I missing something? If I'm right, seems like someone would have HAD to have noticed this by now. Unless everyone is always passing a
size
that is divisible byself.page_size()
, anyone who is relying on the "at leastsize
" guarantee would have been "short changed", which I imagine would very often cause unrecoverable problems...The text was updated successfully, but these errors were encountered: