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

when code, must the buffer be aligned with 64? #41

Closed
liujiangang01 opened this issue Jul 12, 2018 · 3 comments
Closed

when code, must the buffer be aligned with 64? #41

liujiangang01 opened this issue Jul 12, 2018 · 3 comments

Comments

@liujiangang01
Copy link

No description provided.

@gbtucker
Copy link
Contributor

We have eliminated most of the alignment restrictions in various units but a few remain in raid functions. The documentation will list any necessary alignment restrictions on input buffers.

@liujiangang01
Copy link
Author

In file of erasure_code_test.c, I see the example which allocate buffer align,if not align,can it work well? if not,why must be align?
1531446016 1

@gbtucker
Copy link
Contributor

In this unit test we explicitly align so that we can explicitly test the unaligned cases also by shifting buffers up to a page border and running with efence. Malloc will normally align anyway but this will help so that efence_buffer = buffer + buffer_len - test_size will push up against a page boundary and help us test against readover. In your user code, alignment is not a requirement and it should work will without.

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

2 participants