bashor edited issue #13808:
Look at crash reports in #13756.
alexcrichton added the wasm-proposal:gc label to Issue #13808.
fitzgen commented on issue #13808:
We use that
bytes_neededboth for (1) communicating to the main runtime the bytes we need to grow the GC heap by in order to satisfy the allocation, and (2) reporting error messages to the user. We wouldn't want to just remove that doubling because that would break (1). Arguably it would also make us lie in (2) because even though the object's size is $x$ we needed (and failed) to allocate $x2$, and we could get into situations where there "is space" for a large array when looking at the entire GC heap's capacity, but there isn't space for 2sizeof(array), which is what is actually needed to be able to allocate the array.Maybe the solution is just to add the requested allocation size as context to an error or something.
bashor commented on issue #13808:
Maybe the solution is just to add the requested allocation size as context to an error or something.
Yeah, I think it's worth improving the message. From my experience with the current message, at first I thought the reported number was the size required for a struct we tried to allocate on the last frame, which sounded too much, so I dug into the sources.
Last updated: Jul 29 2026 at 05:03 UTC