-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
468: Use `List` for `Kmem` r=jeehoonkang a=Medowhill 원래 `Kmem`은 자체적인 intrusive linked list를 사용하도록 구현되어 있었는데, 이를 이미 rv6가 가지고 있는 instrusive linked list 타입인 `List`를 사용하도록 수정했습니다. 원래 `Kmem`에서는 singly linked list를 사용하지만 `List` 타입은 doubly linked list인 것 등의 사소한 차이가 있고, 이로 인해 약간의 runtime overhead가 추가될 수는 있겠으나 무시할 수 있을 정도라고 생각합니다. 어차피 핵심은 `Kmem`이 intrusive linked list로 구현되어야 한다는 점이니, `Kmem`을 이미 존재하는 `List` 타입을 사용해 구현하는 것이 더 바람직한 방향인 것 같습니다. 469: [Closes #371] Use `const Default` trait in arena. r=jeehoonkang a=travis1829 Closes #371 ### Changes `ArrayArena`/`MruArena`의 `new` method를 변경했습니다. 기존: ```Rust pub const fn new(entries: [RcCell<T>; CAPACITY]) -> Self; // ArrayArena pub const fn new(entries: [MruEntry<T>; CAPACITY]) -> Self; // MruArena ``` 변경 후: ```Rust pub const fn new<D: Default>() -> Self; // ArrayArena pub const fn new<D: Default>() -> Self; // MruArena ``` ----- * 기존에는 caller가 직접 초기화된 배열을 제공하는 형태였기 때문에, caller가 malicious한 배열을 제공하게 되면 문제가 생길 수 있었습니다. * 변경 후에는 `ArrayArena`/`MruArena`가 직접 배열을 만들고 초기화합니다. * 이를 위해서, `Default` trait을 요구하도록 변경했습니다. (`const fn`안에서는 closure나 function pointer를 사용할 수 없는 것으로 보입니다.) * 특히, `Default` trait을 `const fn`안에서 사용하기 위해서, `#![feature(const_impl_trait)]`을 사용했습니다. Co-authored-by: Jaemin Hong <hjm0901@gmail.com> Co-authored-by: travis1829 <travis1829@naver.com>
- Loading branch information
Showing
11 changed files
with
180 additions
and
114 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.