Skip to content
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

内存不对齐访问 #130

Open
FighterChan opened this issue Dec 4, 2021 · 2 comments
Open

内存不对齐访问 #130

FighterChan opened this issue Dec 4, 2021 · 2 comments

Comments

@FighterChan
Copy link

EfErrCode ef_port_read(uint32_t addr, uint32_t *buf, size_t size);
EfErrCode ef_port_write(uint32_t addr, const uint32_t *buf, size_t size);

第二个参数设计成uint32_t *类型,传参后指向uint8_t * 类型,不会有内存非对齐访问的风险吗?

@i-jaffer
Copy link
Contributor

i-jaffer commented Dec 7, 2022

我也觉得这里使用uint8_t*要好一点,不知开发者是否有其他用意

@armink
Copy link
Owner

armink commented Dec 10, 2022

是的,uint8_t * 会更好,只是由于兼容性的考虑,暂时没有调整。目前 FlashDB 已经将这块改进了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants