Skip to content
Merged
Show file tree
Hide file tree
Changes from 54 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
440613d
Implementation proposal of P0053R7 basic_syncbuf
Jan 11, 2021
d8e0433
Updates to syncbuf implementation, syncstream header to build system
Jan 11, 2021
71c6504
Apply suggestions from code review
Jan 11, 2021
a41104f
clang-format
Jan 11, 2021
4f469e8
Remove redefinition of default parameter occurrence
Jan 11, 2021
215307c
Remove a mistaken definition
Jan 11, 2021
6afbbc7
Move global variables to syncstream.cpp
Jan 11, 2021
56bf7d6
Update syncstream.cpp with static variables
Jan 11, 2021
1f71232
Apply code review and changes to global mutex design
Jan 12, 2021
146d5de
Remove unnecessary guards
Jan 12, 2021
5f15919
Update included headers
Jan 12, 2021
31169f6
clang-format
Jan 12, 2021
103e07e
Remove unnecessary header, adjust variable names
Jan 12, 2021
9e05bb2
Add basic_osyncstream class
Jan 12, 2021
7889ef0
Apply code review changes
Jan 13, 2021
df7aea1
Add custom CRT Allocator
Jan 13, 2021
fa3c112
Apply code review changes
Jan 13, 2021
2a3ab4e
Adjust noexcept flag and throw on null allocation
Jan 13, 2021
cd29990
Implement intermediate class for basic_syncbuf
Jan 13, 2021
472b800
Implement osyncstream manipulators
Jan 13, 2021
5bdb646
Apply code review changes
Jan 14, 2021
f7aa45d
Properly move assign equal _No_propagate_allocators
Jan 14, 2021
0a1ce0e
Ensure dealing _Unfancy pointers with streambuf
Jan 15, 2021
12ac2f9
Add tests to basic_syncbuf and feature test macro
Jan 15, 2021
acbf0bf
organize include headers
Jan 15, 2021
95e50c4
Fix tests
Jan 15, 2021
e355673
Fix tests again
Jan 15, 2021
5a085af
Add the new test to the list
Jan 15, 2021
e4bbea1
Add tests for basic_osyncstream
Jan 16, 2021
3554be3
Add osyncstream manipulators tests and enable a disabled test
Jan 16, 2021
3cccfc3
clang-format
Jan 16, 2021
f873fdd
Fix typo
Jan 16, 2021
1f7e98d
Add syncstream header to header-units
Jan 18, 2021
2452024
Guard functions that require runtime information checking
Jan 23, 2021
35918c5
Fix bugs
Jan 27, 2021
d1ffbe6
Apply some code review changes
Jan 29, 2021
41b9540
Merge branch 'main' into syncstream
StephanTLavavej Feb 5, 2021
430944c
Code review feedback.
StephanTLavavej Feb 5, 2021
c2e3705
change flush_emit to follow the standard wording
Feb 5, 2021
8101d4b
Workaround EHsc compiler flag with throwing extern C
Feb 5, 2021
5b13b44
clang-format
Feb 5, 2021
bc13608
Inline _Acquire_mutex_for_instance
Feb 5, 2021
19a747c
Disable header units test coverage.
StephanTLavavej Feb 6, 2021
e7fc1c9
Use _Xbad_alloc() to throw.
StephanTLavavej Feb 6, 2021
7f70310
Don't use _CRTIMP2 for import-lib functions.
StephanTLavavej Feb 6, 2021
019e25f
Rename _Lookup_map and _Lookup_mutex.
StephanTLavavej Feb 6, 2021
37fab1e
Use size_t for refcounts instead of uint64_t.
StephanTLavavej Feb 6, 2021
9af6598
Move code into the atomic_wait satellite DLL.
StephanTLavavej Feb 6, 2021
8b89ab0
Increase efficiency by caching the mutex pointer.
StephanTLavavej Feb 6, 2021
b42dfe9
Refactor duplicate test code
Feb 7, 2021
e7ed875
Use _Compressed_pair.
StephanTLavavej Feb 7, 2021
ec2a3a5
Code review feedback for tests.
StephanTLavavej Feb 7, 2021
bbdfc77
Return shared_mutex*, comment that this isn't really flat.
StephanTLavavej Feb 8, 2021
2763e9f
move fancy pointer test to VSO_0000000_fancy_pointers
Feb 8, 2021
eeb28aa
Attempt to achieve a conformant allocator
Feb 8, 2021
a0faf59
Update test
Feb 8, 2021
a9db2ca
Add explicit.
StephanTLavavej Feb 9, 2021
33b19d0
stl/msbuild changes.
StephanTLavavej Feb 9, 2021
627641f
stl/msbuild: Drop special_math.cpp comment.
StephanTLavavej Feb 16, 2021
b3aad6f
Use _Init_locks.
StephanTLavavej Feb 17, 2021
45a47b4
Merge branch 'main' into syncstream
StephanTLavavej Feb 17, 2021
d70684f
Remove noexcept from move/swap machinery, mention LWG-3498.
StephanTLavavej Feb 19, 2021
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
4 changes: 3 additions & 1 deletion stl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ set(HEADERS
${CMAKE_CURRENT_LIST_DIR}/inc/string
${CMAKE_CURRENT_LIST_DIR}/inc/string_view
${CMAKE_CURRENT_LIST_DIR}/inc/strstream
${CMAKE_CURRENT_LIST_DIR}/inc/syncstream
${CMAKE_CURRENT_LIST_DIR}/inc/system_error
${CMAKE_CURRENT_LIST_DIR}/inc/thread
${CMAKE_CURRENT_LIST_DIR}/inc/tuple
Expand Down Expand Up @@ -396,6 +397,7 @@ set(SOURCES_SATELLITE_2
set(SOURCES_SATELLITE_ATOMIC_WAIT
${CMAKE_CURRENT_LIST_DIR}/src/atomic_wait.cpp
${CMAKE_CURRENT_LIST_DIR}/src/parallel_algorithms.cpp
${CMAKE_CURRENT_LIST_DIR}/src/syncstream.cpp
)

set(SOURCES_SATELLITE_CODECVT_IDS
Expand Down Expand Up @@ -495,7 +497,7 @@ function(add_stl_dlls D_SUFFIX THIS_CONFIG_DEFINITIONS THIS_CONFIG_COMPILE_OPTIO
file(WRITE "${_ATOMIC_WAIT_DEF_NAME}" "${_ATOMIC_WAIT_DEF_CONTENTS}")

add_library(msvcp${D_SUFFIX}_atomic_wait SHARED "${_ATOMIC_WAIT_DEF_NAME}")
target_link_libraries(msvcp${D_SUFFIX}_atomic_wait PRIVATE msvcp${D_SUFFIX}_atomic_wait_objects msvcp${D_SUFFIX}_satellite_objects "msvcp${D_SUFFIX}" "${TOOLSET_LIB}/vcruntime${D_SUFFIX}.lib" "${TOOLSET_LIB}/msvcrt${D_SUFFIX}.lib" "ucrt${D_SUFFIX}.lib")
target_link_libraries(msvcp${D_SUFFIX}_atomic_wait PRIVATE msvcp${D_SUFFIX}_atomic_wait_objects msvcp${D_SUFFIX}_satellite_objects msvcp${D_SUFFIX}_implib_objects "msvcp${D_SUFFIX}" "${TOOLSET_LIB}/vcruntime${D_SUFFIX}.lib" "${TOOLSET_LIB}/msvcrt${D_SUFFIX}.lib" "ucrt${D_SUFFIX}.lib")
set_target_properties(msvcp${D_SUFFIX}_atomic_wait PROPERTIES ARCHIVE_OUTPUT_NAME "msvcp140_atomic_wait${D_SUFFIX}${VCLIBS_SUFFIX}")
set_target_properties(msvcp${D_SUFFIX}_atomic_wait PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
set_target_properties(msvcp${D_SUFFIX}_atomic_wait PROPERTIES OUTPUT_NAME "${_ATOMIC_WAIT_OUTPUT_NAME}")
Expand Down
1 change: 1 addition & 0 deletions stl/inc/__msvc_all_public_headers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
#include <string>
#include <string_view>
#include <strstream>
#include <syncstream>
#include <system_error>
#include <tuple>
#include <typeindex>
Expand Down
1 change: 1 addition & 0 deletions stl/inc/header-units.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
"string",
"string_view",
"strstream",
"syncstream",
"system_error",
"thread",
"tuple",
Expand Down
16 changes: 16 additions & 0 deletions stl/inc/iosfwd
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,14 @@ template <class _Elem, class _Traits = char_traits<_Elem>>
class basic_ofstream;
template <class _Elem, class _Traits = char_traits<_Elem>>
class basic_fstream;
#if _HAS_CXX20
template <class _Elem, class _Traits = char_traits<_Elem>>
class _Basic_syncbuf_impl;
template <class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
class basic_syncbuf;
template <class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
class basic_osyncstream;
#endif // _HAS_CXX20

#if defined(_DLL_CPPLIB)
template <class _Elem, class _InIt>
Expand All @@ -224,6 +232,10 @@ using filebuf = basic_filebuf<char, char_traits<char>>;
using ifstream = basic_ifstream<char, char_traits<char>>;
using ofstream = basic_ofstream<char, char_traits<char>>;
using fstream = basic_fstream<char, char_traits<char>>;
#if _HAS_CXX20
using syncbuf = basic_syncbuf<char>;
using osyncstream = basic_osyncstream<char>;
#endif // _HAS_CXX20

// wchar_t TYPEDEFS
using wios = basic_ios<wchar_t, char_traits<wchar_t>>;
Expand All @@ -239,6 +251,10 @@ using wfilebuf = basic_filebuf<wchar_t, char_traits<wchar_t>>;
using wifstream = basic_ifstream<wchar_t, char_traits<wchar_t>>;
using wofstream = basic_ofstream<wchar_t, char_traits<wchar_t>>;
using wfstream = basic_fstream<wchar_t, char_traits<wchar_t>>;
#if _HAS_CXX20
using wsyncbuf = basic_syncbuf<wchar_t>;
using wosyncstream = basic_osyncstream<wchar_t>;
#endif // _HAS_CXX20

#if defined(_CRTBLD)
// unsigned short TYPEDEFS
Expand Down
39 changes: 39 additions & 0 deletions stl/inc/ostream
Original file line number Diff line number Diff line change
Expand Up @@ -993,6 +993,45 @@ basic_ostream<_Elem, _Traits>& __CLRCALL_OR_CDECL flush(basic_ostream<_Elem, _Tr
return _Ostr;
}

#if _HAS_CXX20
#ifdef _CPPRTTI
template <class _Elem, class _Traits>
basic_ostream<_Elem, _Traits>& emit_on_flush(basic_ostream<_Elem, _Traits>& _Ostr) {
const auto _Sync_buf_ptr = dynamic_cast<_Basic_syncbuf_impl<_Elem, _Traits>*>(_Ostr.rdbuf());
if (_Sync_buf_ptr) {
_Sync_buf_ptr->set_emit_on_sync(true);
}
return _Ostr;
}

template <class _Elem, class _Traits>
basic_ostream<_Elem, _Traits>& noemit_on_flush(basic_ostream<_Elem, _Traits>& _Ostr) {
const auto _Sync_buf_ptr = dynamic_cast<_Basic_syncbuf_impl<_Elem, _Traits>*>(_Ostr.rdbuf());
if (_Sync_buf_ptr) {
_Sync_buf_ptr->set_emit_on_sync(false);
}
return _Ostr;
}

template <class _Elem, class _Traits>
basic_ostream<_Elem, _Traits>& flush_emit(basic_ostream<_Elem, _Traits>& _Ostr) {
_Ostr.flush();
const auto _Sync_buf_ptr = dynamic_cast<_Basic_syncbuf_impl<_Elem, _Traits>*>(_Ostr.rdbuf());
if (_Sync_buf_ptr) {
_Sync_buf_ptr->_Do_emit();
}
return _Ostr;
}
#else // _CPPRTTI
template <class _Elem, class _Traits>
basic_ostream<_Elem, _Traits>& emit_on_flush(basic_ostream<_Elem, _Traits>&) = delete; // requires /GR option
template <class _Elem, class _Traits>
basic_ostream<_Elem, _Traits>& noemit_on_flush(basic_ostream<_Elem, _Traits>&) = delete; // requires /GR option
template <class _Elem, class _Traits>
basic_ostream<_Elem, _Traits>& flush_emit(basic_ostream<_Elem, _Traits>&) = delete; // requires /GR option
#endif // _CPPRTTI
#endif // _HAS_CXX20

// INSERTER FOR error_category
template <class _Elem, class _Traits>
basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr,
Expand Down
Loading