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

Logic cleanups for basic_string #3862

Merged
merged 26 commits into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
45e738d
Make `string(const T*)` and `string(const T*, const Alloc&)` adjacent
achabense Jul 11, 2023
9f726f9
Add `_NODISCARD` for `_String_val` methods
achabense Jul 27, 2023
02b90ed
make `_Activate_SSO_buffer` `_CONSTEXPR20`
achabense Jul 27, 2023
ca0953a
Make types of `_BUF_SIZE` and `_ALLOC_MASK` clear
achabense Jul 11, 2023
ef708ed
Introduce `_SMALL_STRING_CAPACITY`; replace `_BUF_SIZE - 1` with it
achabense Jul 11, 2023
d3f736b
Refine `_Large_string_engaged`; find a missed usecase for it
achabense Jul 11, 2023
e1ce499
Introduce `_Entails_large_string`; replace wild `_Large_string_engage…
achabense Jul 11, 2023
e050101
Replace capacity-decision logic with `_Entails_large_string`
achabense Jul 11, 2023
2b966c6
Refine documentation of interaction part with `basic_stringbuf`
achabense Jul 11, 2023
d0c9dfc
Try to improve documentation for `_Mysize` and `_Myres`
achabense Jul 27, 2023
cb010d7
Replace two `auto`s with explicit types.
achabense Jul 28, 2023
28c834e
Introduce `_Allocate_for_capacity` and `_Deallocate_for_capacity` and…
achabense Jul 27, 2023
5ba8339
Fix a misuse of `_Large_string_engaged` (which will otherwise break t…
achabense Jul 27, 2023
9b729de
Serially run the tests in Dev09_181509_tr1_inf_loop_uniform_int_ull.
StephanTLavavej Jul 27, 2023
2b017db
Fix comment grammar.
StephanTLavavej Jul 28, 2023
e600d39
In `_Deallocate_for_capacity`, pass `_Old_ptr` by value.
StephanTLavavej Jul 28, 2023
6f8a3cb
Drop redundant `public:` after the removal of `_Copy_assign_val_from_…
StephanTLavavej Jul 28, 2023
0baefec
Add `test_string_copy_assign_pocca_sso()`.
StephanTLavavej Jul 28, 2023
9b0e590
Restore `shrink_to_fit` to allocate exactly.
StephanTLavavej Jul 28, 2023
3a27c90
`_Reallocation_policy` => `_Allocation_policy`
StephanTLavavej Jul 28, 2023
6ea7f29
Rename to avoid macro identifier space
CaseyCarter Aug 9, 2023
a2cb72b
Rename `_Large_string_engaged` to `_Large_mode_engaged`
CaseyCarter Aug 9, 2023
9921deb
Expand `_Entails_large_string` into callsites
CaseyCarter Aug 9, 2023
84b8ced
"small mode" instead of "SSO mode"
CaseyCarter Aug 9, 2023
9ed46dc
Rename `_Buf_res` and `_Released_buffer::_Res`
CaseyCarter Aug 9, 2023
e2ac4ce
Don't enumerate users of `_Least_allocation_size`
CaseyCarter Aug 9, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions stl/inc/sstream
Original file line number Diff line number Diff line change
Expand Up @@ -473,11 +473,11 @@ protected:
}

// finite buffer that can be read or written, set it up
auto [_Ptr, _Size, _Res] = _Str._Release_to_buffer(_Al);
_Elem* const _Pnew = _Unfancy(_Ptr);
_Seekhigh = _Pnew + _Size;
auto _Next = (_State & (_Atend | _Append)) ? _Seekhigh : _Pnew;
auto _End_buffer = _Pnew + _Res;
auto [_Ptr, _Size, _Actual_allocation_size] = _Str._Release_to_buffer(_Al);
_Elem* const _Pnew = _Unfancy(_Ptr);
_Seekhigh = _Pnew + _Size;
auto _Next = (_State & (_Atend | _Append)) ? _Seekhigh : _Pnew;
auto _End_buffer = _Pnew + _Actual_allocation_size;

_Mysb::setp(_Pnew, _Next, _End_buffer);
if (_State & _Noread) { // maintain "_Allocated == eback() points to buffer base" invariant
Expand Down
Loading