[Alloc] Fixed alignment for shared memory allocation#3854
Merged
Jokeren merged 3 commits intotriton-lang:mainfrom May 13, 2024
Merged
[Alloc] Fixed alignment for shared memory allocation#3854Jokeren merged 3 commits intotriton-lang:mainfrom
Jokeren merged 3 commits intotriton-lang:mainfrom
Conversation
Contributor
sjw36
commented
May 7, 2024
- Increment buffers just past max interference buffer
* Increment buffers just past max interference buffer
Contributor
Author
|
@ThomasRaoux @Jokeren , this should be just the alignment fix. |
Contributor
Author
|
I did remove the |
Jokeren
reviewed
May 7, 2024
| std::min(range.end(), xRange.end())}}); | ||
| size_t offset = size; | ||
| if (size_t diff = offset % buffer->alignment) | ||
| offset += buffer->alignment - diff; |
Contributor
There was a problem hiding this comment.
What's the difference between this and the previous calculation?
Contributor
There was a problem hiding this comment.
if (size_t diff = newOffset % x->alignment) {
// fix alignment
newOffset += x->alignment - diff;
}
I'm fine with the change. It's just that:
- I'm curious about the differences
- And maybe you could make this as a function as it's being used multiple times (here and below).
Contributor
Author
There was a problem hiding this comment.
It gets the same value, just a different way to compute. I just thought this was more clear but the alternative is a single unconditional line. I'll make it a BufferT member function.
Contributor
|
@sjw36 Thank you Simon! |
antiagainst
requested changes
May 8, 2024
Jokeren
approved these changes
May 10, 2024
Contributor
Author
|
@antiagainst your request should be resolved. Please verify |
antiagainst
approved these changes
May 13, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.