-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question about alignment #27
Comments
I guess my question would "large enough" for what? There's a couple of directions this could go but I'm not exactly sure what you mean? |
i meant large enough for the actual contents. eg. f32. |
WITX is a view over guest slice, WIT is a copy. Alignment has the potential to be an issue, but everything will likely work fine on Linux and Windows due to the default behavior of allocator (i.e if it uses malloc). On Ubuntu, many other linux systems malloc, and windows returns a pointer aligned to either 8 or 16 bytes:
So whether alignment will be an issue will depend on the allocator used by the wasm host and the underlying platform. |
Additional quick follow up here is that most C compilers adhering to the standard allow casting between any valid pointer types, so everything should be fine unless there's a use case where alignment greater than 16 bytes is required (in some case 8 bytes emscripten-core/emscripten#5996 and emscripten-core/emscripten#10072). This mainly seems to be AVX or AVX512, but if the use case does present itself it can be handled on host side. |
tensor-data is
list<u8>
.but i suppose that its actual contents are eg. f32.
does wit/interface-types/etc provide a large enough alignment?
The text was updated successfully, but these errors were encountered: