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.
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
[Closes #371] Use
const Default
trait in arena. #469[Closes #371] Use
const Default
trait in arena. #469Changes from 1 commit
2151601
6b8c9eb
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new
가 아니라new_locked
를 만드는 이유는?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...Arena
자체를 접근하는건 arena.rs 내부에서만 해야하고, 외부에서는 항상Spinlock
에 감싸진 형태로 접근해야합니다....Arena
를 가지고서는 할 수 있는게 없습니다. (사용할 수 있는 API가 없습니다.)new
가Self
를 리턴하는 것보다Spinlock<Self>
를 리턴하는게 위 사항을 더 잘 나타낸다고 생각하여 변경했습니다.다만, 혹시 이전으로 다시 되돌리기를 원하시면 말씀해주세요.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
왜 그런가요? Arena 자체는 spinlock 없이도 API를 잘 만들 수 있는게 아닌가 싶어서 질문드립니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
다시
new
로 변경했습니다.지금의
ArrayArena
/MruArena
는 multi thread에서는 사용할 수 없으므로, 항상Spinlock
에 감싸져있어야해서 이렇게 생각했는데, 말씀하신것처럼 arena를 single thread에서 사용할 수도 있고 이미MruArena::init
같은 API가 존재하므로, 다시 변경했습니다.