On Tue, 6 Jul 2021 at 21:12, Zebediah Figura (she/her) zfigura@codeweavers.com wrote:
The problem I see with the compiler error messages is that they universally try to allocate more memory than we just failed to allocate.
I don't think that's necessarily true. Both string buffers and byte code buffers grow by doubling the existing allocation size; the amount of memory they try to allocate is determined by the existing size, not the amount of data we try to write to it. It's also very well possible that the error message string buffer still has sufficient remaining space to not require growing in order to write the message. (Incidentally, it's not entirely inconceivable that future versions of the API would support simply writing directly to stdin/stdout/stderr, perhaps even by using custom input/output/error callbacks.)