LibWasm: Avoid making StringView of temporary ByteBuffer

This commit is contained in:
Ben Wiederhake 2021-09-10 23:43:11 +02:00 committed by Idan Horowitz
commit 6c8eea6f5e
Notes: sideshowbarker 2024-07-18 04:17:36 +09:00

View file

@ -88,7 +88,8 @@ void Configuration::dump_stack()
{ {
DuplexMemoryStream memory_stream; DuplexMemoryStream memory_stream;
Printer { memory_stream }.print(vs...); Printer { memory_stream }.print(vs...);
dbgln(format.view(), StringView(memory_stream.copy_into_contiguous_buffer()).trim_whitespace()); ByteBuffer buffer = memory_stream.copy_into_contiguous_buffer();
dbgln(format.view(), StringView(buffer).trim_whitespace());
}; };
for (auto const& entry : stack().entries()) { for (auto const& entry : stack().entries()) {
entry.visit( entry.visit(