Conversation
3e428c6 to
ed6dfca
Compare
zherczeg
left a comment
There was a problem hiding this comment.
LGTM.
This will be harder for me to follow, but I will figure out something.
Why does it make things harder? Maybe its not worth it? |
|
Unfortunately we need to support older systems, even where std::string_view is not available :) With some custom headers and |
|
Oh I didn't realize you have those limitations. What version of C++ are you stuck on? |
|
C++ 14 |
That is a unfortunate. Do you know when you might be able to update? |
|
Don't know, it is not my decision. Anyway, I will figure something out to maintain backwards compatiblity. |
Replace legacy raw pointer and size pairs with std::span<const uint8_t> (aliased to `ByteSpan`) across WABT's binary reader interfaces, writer streams, parser callbacks, and public entry points. This greatly improves type safety, simplifies call sites (allowing vectors and arrays to be passed directly), and aligns WABT with modern C++20 standards. Highlights: - Fixes a performance bug in Stream::WriteData where passing std::vector accidentally triggered a full copy-by-value of the vector's contents. The template overload now correctly accepts std::span (zero-copy). - Simplifies various writing call sites (e.g. in binary-writer, c-writer, and wasm-strip) by passing vectors directly or leveraging subspan.
Replace legacy raw pointer and size pairs with std::span
(aliased to
ByteSpan) across WABT's binary reader interfaces, writerstreams, parser callbacks, and public entry points.
This greatly improves type safety, simplifies call sites (allowing vectors
and arrays to be passed directly), and aligns WABT with modern C++20
standards.
Highlights:
accidentally triggered a full copy-by-value of the vector's contents.
The template overload now correctly accepts std::span (zero-copy).
and wasm-strip) by passing vectors directly or leveraging subspan.