Give til::bitmap custom allocator support and add til::pmr::bitmap#8787
Merged
2 commits merged intomainfrom Jan 19, 2021
Merged
Give til::bitmap custom allocator support and add til::pmr::bitmap#87872 commits merged intomainfrom
2 commits merged intomainfrom
Conversation
til::details::bitmap<Allocator> will use Allocator for its dynamic_bitset, and it will use a rebound allocator for its run storage. Allocator should be an allocator type storing `unsigned long long`, the backing store type for dynamic_bitset. I've introduced a type alias, `til::bitmap`, which papers over the allocator choice for all existing code. I've also introduced a second type alias, `til::pmr::bitmap`, which lets a consumer use the C++ polymorphic allocator system.
DHowett
commented
Jan 14, 2021
src/inc/til/bitmap.h
Outdated
| _rc(sz), | ||
| _bits(_sz.area()), | ||
| _runs{} | ||
| _bits(_sz.area(), fill ? std::numeric_limits<unsigned long long>::max() : 0, _alloc), |
Member
Author
There was a problem hiding this comment.
functional change, but minor. instead of using set_all to fill all the bits, we are constructing the dynamic_bitset with 0xffffffffffffffff stored in its blocks. It has the same effect!
Member
Author
|
I had to reindent the file because of namespace nesting. Review with whitespace hidden. |
6 tasks
miniksa
approved these changes
Jan 15, 2021
6 tasks
carlos-zamora
approved these changes
Jan 19, 2021
|
Hello @DHowett! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
mpela81
pushed a commit
to mpela81/terminal
that referenced
this pull request
Jan 28, 2021
…icrosoft#8787) `til::details::bitmap<Allocator>` will use `Allocator` for its `dynamic_bitset`, and it will use a rebound allocator for its run storage. Allocator should be an allocator type storing `unsigned long long`, the backing store type for `dynamic_bitset`. I've introduced a type alias, `til::bitmap`, which papers over the allocator choice for all existing code. I've also introduced a second type alias, `til::pmr::bitmap`, which lets a consumer use the C++ polymorphic allocator system. I chatted with @miniksa about whether to keep the "full" allocator version in `details` or not. We decided that for the simplicity of the `til` namespace, we would. If anybody has a compelling reason to use `til::details::bitmap<Allocator>` directly, we can re-evaluate this decision.
lhecker
added a commit
that referenced
this pull request
May 14, 2021
* #8000 - Supports buffer rewrite work. A re-use of `til::rle` will be useful as a column counter as we pursue NxM storage and presentation. * #3075 - The new iterators allow skipping forward by multiple units, which wasn't possible under `TextBuffer-/OutputCellIterator`. Additionally it also allows a bulk insertions. * #8787 and #410 - High probability this should be `pmr`-ified like `bitmap` for things like `chafa` and `cacafire` which are changing the run length frequently. * [x] Closes #8741 * [x] I work here. * [x] Tests added. * [x] Tests passed. - [x] Ran `cacafire` in `OpenConsole.exe` and it looked beautiful - [x] Ran new suite of `RunLengthEncodingTests.cpp` Co-authored-by: Michael Niksa <[email protected]>
lhecker
added a commit
that referenced
this pull request
May 14, 2021
## Summary of the Pull Request Introduces `til::rle`, a vector-like container which stores elements of type T in a run length encoded format. This allows efficient compaction of repeated elements within the vector. ## References * #8000 - Supports buffer rewrite work. A re-use of `til::rle` will be useful as a column counter as we pursue NxM storage and presentation. * #3075 - The new iterators allow skipping forward by multiple units, which wasn't possible under `TextBuffer-/OutputCellIterator`. Additionally it also allows a bulk insertions. * #8787 and #410 - High probability this should be `pmr`-ified like `bitmap` for things like `chafa` and `cacafire` which are changing the run length frequently. ## PR Checklist * [x] Closes #8741 * [x] I work here. * [x] Tests added. * [x] Tests passed. ## Validation Steps Performed * [x] Ran `cacafire` in `OpenConsole.exe` and it looked beautiful * [x] Ran new suite of `RunLengthEncodingTests.cpp` Co-authored-by: Michael Niksa <[email protected]>
6 tasks
lhecker
added a commit
that referenced
this pull request
May 14, 2021
## Summary of the Pull Request Introduces `til::rle`, a vector-like container which stores elements of type T in a run length encoded format. This allows efficient compaction of repeated elements within the vector. ## References * #8000 - Supports buffer rewrite work. A re-use of `til::rle` will be useful as a column counter as we pursue NxM storage and presentation. * #3075 - The new iterators allow skipping forward by multiple units, which wasn't possible under `TextBuffer-/OutputCellIterator`. Additionally it also allows a bulk insertions. * #8787 and #410 - High probability this should be `pmr`-ified like `bitmap` for things like `chafa` and `cacafire` which are changing the run length frequently. ## PR Checklist * [x] Closes #8741 * [x] I work here. * [x] Tests added. * [x] Tests passed. ## Validation Steps Performed * [x] Ran `cacafire` in `OpenConsole.exe` and it looked beautiful * [x] Ran new suite of `RunLengthEncodingTests.cpp` Co-authored-by: Michael Niksa <[email protected]>
lhecker
added a commit
that referenced
this pull request
May 14, 2021
## Summary of the Pull Request Introduces `til::rle`, a vector-like container which stores elements of type T in a run length encoded format. This allows efficient compaction of repeated elements within the vector. ## References * #8000 - Supports buffer rewrite work. A re-use of `til::rle` will be useful as a column counter as we pursue NxM storage and presentation. * #3075 - The new iterators allow skipping forward by multiple units, which wasn't possible under `TextBuffer-/OutputCellIterator`. Additionally it also allows a bulk insertions. * #8787 and #410 - High probability this should be `pmr`-ified like `bitmap` for things like `chafa` and `cacafire` which are changing the run length frequently. ## PR Checklist * [x] Closes #8741 * [x] I work here. * [x] Tests added. * [x] Tests passed. ## Validation Steps Performed * [x] Ran `cacafire` in `OpenConsole.exe` and it looked beautiful * [x] Ran new suite of `RunLengthEncodingTests.cpp` Co-authored-by: Michael Niksa <[email protected]>
DHowett
added a commit
that referenced
this pull request
May 18, 2021
commit 4b0eeef Author: Leonard Hecker <[email protected]> Date: Fri May 14 23:56:08 2021 +0200 Introduce til::rle - a run length encoded vector ## Summary of the Pull Request Introduces `til::rle`, a vector-like container which stores elements of type T in a run length encoded format. This allows efficient compaction of repeated elements within the vector. ## References * #8000 - Supports buffer rewrite work. A re-use of `til::rle` will be useful as a column counter as we pursue NxM storage and presentation. * #3075 - The new iterators allow skipping forward by multiple units, which wasn't possible under `TextBuffer-/OutputCellIterator`. Additionally it also allows a bulk insertions. * #8787 and #410 - High probability this should be `pmr`-ified like `bitmap` for things like `chafa` and `cacafire` which are changing the run length frequently. ## PR Checklist * [x] Closes #8741 * [x] I work here. * [x] Tests added. * [x] Tests passed. ## Validation Steps Performed * [x] Ran `cacafire` in `OpenConsole.exe` and it looked beautiful * [x] Ran new suite of `RunLengthEncodingTests.cpp` Co-authored-by: Michael Niksa <[email protected]>
ghost
pushed a commit
that referenced
this pull request
May 20, 2021
## Summary of the Pull Request Introduces `til::rle`, a vector-like container which stores elements of type T in a run length encoded format. This allows efficient compaction of repeated elements within the vector. ## References * #8000 - Supports buffer rewrite work. A re-use of `til::rle` will be useful as a column counter as we pursue NxM storage and presentation. * #3075 - The new iterators allow skipping forward by multiple units, which wasn't possible under `TextBuffer-/OutputCellIterator`. Additionally it also allows a bulk insertions. * #8787 and #410 - High probability this should be `pmr`-ified like `bitmap` for things like `chafa` and `cacafire` which are changing the run length frequently. ## PR Checklist * [x] Closes #8741 * [x] I work here. * [x] Tests added. * [x] Tests passed. ## Validation Steps Performed * [x] Ran `cacafire` in `OpenConsole.exe` and it looked beautiful * [x] Ran new suite of `RunLengthEncodingTests.cpp` Co-authored-by: Michael Niksa <[email protected]>
This pull request was closed.
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.
til::details::bitmap<Allocator>will useAllocatorfor itsdynamic_bitset, and it will use a rebound allocator for its run storage.Allocator should be an allocator type storing
unsigned long long, thebacking store type for
dynamic_bitset.I've introduced a type alias,
til::bitmap, which papers over theallocator choice for all existing code. I've also introduced a second
type alias,
til::pmr::bitmap, which lets a consumer use the C++polymorphic allocator system.
I chatted with @miniksa about whether to keep the "full" allocator
version in
detailsor not. We decided that for the simplicity of thetilnamespace, we would. If anybody has a compelling reason to usetil::details::bitmap<Allocator>directly, we can re-evaluate thisdecision.