Closed fuzzywang closed 2 years ago
How are you getting these errors? Which fields? How are the files written/read?
There's code to keep things aligned: https://github.com/s-yata/marisa-trie/blob/006020c1df76d0d7dc6118dacc22da64da2e35c4/lib/marisa/grimoire/vector/vector.h#L205
I concat all resources file including marisa dump file as the Android assets. Then mmap and split them. So the file may not be aligned.
Align before you write the marisa data by either seeking or writing 0 bytes. For some reason, 16 byte alignment sticks in my head, but the code I pointed to is only 8 byte aligned. Does that fix it?
Writing 0 bytes before concat fix that. Thanks
Unaligned memory visit is not allowed in armv7a, so just memcpy T to make it works.