From 7c3e085e4405ef4148edf4ea5bedd7930df23c58 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Wed, 24 Apr 2019 23:16:45 +0100 Subject: [PATCH] Update C++17 library status tables * doc/xml/manual/status_cxx2017.xml: Document P0024R2 status. * doc/html/*: Regenerate. From-SVN: r270559 --- libstdc++-v3/ChangeLog | 3 + libstdc++-v3/doc/html/faq.html | 26 ++++++-- libstdc++-v3/doc/html/index.html | 2 +- libstdc++-v3/doc/html/manual/api.html | 9 +-- libstdc++-v3/doc/html/manual/backwards.html | 5 +- libstdc++-v3/doc/html/manual/debug.html | 64 +++++++++++-------- .../doc/html/manual/ext_concurrency_impl.html | 2 +- libstdc++-v3/doc/html/manual/ext_io.html | 10 +-- libstdc++-v3/doc/html/manual/index.html | 2 +- libstdc++-v3/doc/html/manual/intro.html | 2 +- .../doc/html/manual/parallel_mode_design.html | 4 +- libstdc++-v3/doc/html/manual/status.html | 17 +++-- libstdc++-v3/doc/html/manual/support.html | 4 +- libstdc++-v3/doc/html/manual/using.html | 7 +- .../doc/xml/manual/status_cxx2017.xml | 15 +++-- 15 files changed, 108 insertions(+), 64 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index abd3b526d2b..b616df758a0 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,8 @@ 2019-04-24 Jonathan Wakely + * doc/xml/manual/status_cxx2017.xml: Document P0024R2 status. + * doc/html/*: Regenerate. + * include/bits/fs_path.h (operator<, operator<=, operator>) (operator>=, operator==, operator!=): Make hidden friends, as per LWG 3065. diff --git a/libstdc++-v3/doc/html/faq.html b/libstdc++-v3/doc/html/faq.html index a0208269dd8..1f6934ef4c8 100644 --- a/libstdc++-v3/doc/html/faq.html +++ b/libstdc++-v3/doc/html/faq.html @@ -70,7 +70,7 @@ Program crashes when using library code in a dynamically-loaded library
6.7. - “Memory leaks” in containers + “Memory leaks” in libstdc++
6.8. list::size() is O(n)!
6.9. @@ -593,7 +593,7 @@ Program crashes when using library code in a dynamically-loaded library
6.7. - “Memory leaks” in containers + “Memory leaks” in libstdc++
6.8. list::size() is O(n)!
6.9. @@ -708,15 +708,27 @@     Link the executable:
    g++ -fPIC -rdynamic -o foo ... -L. -lfoo -ldl
    

6.7.

- “Memory leaks” in containers -

Note

This answer is old and probably no longer be relevant.

- A few people have reported that the standard containers appear + “Memory leaks” in libstdc++ +

+ Since GCC 5.1.0, libstdc++ automatically allocates a pool + of a few dozen kilobytes on startup. This pool is used to ensure it's + possible to throw exceptions (such as bad_alloc) + even when malloc is unable to allocate any more memory. + With some versions of valgrind + this pool will be shown as "still reachable" when the process exits, e.g. + still reachable: 72,704 bytes in 1 blocks. + This memory is not a leak, because it's still in use by libstdc++, + and the memory will be returned to the OS when the process exits. + Later versions of valgrind know how to free this + pool as the process exits, and so won't show any "still reachable" memory. +

+ In the past, a few people reported that the standard containers appear to leak memory when tested with memory checkers such as valgrind. Under some (non-default) configurations the library's allocators keep free memory in a - pool for later reuse, rather than returning it to the OS. Although - this memory is always reachable by the library and is never + pool for later reuse, rather than deallocating it with delete + Although this memory is always reachable by the library and is never lost, memory debugging tools can report it as a leak. If you want to test the library for memory leaks please read Tips for memory leak hunting diff --git a/libstdc++-v3/doc/html/index.html b/libstdc++-v3/doc/html/index.html index 7a8c652cabe..25447dbcefe 100644 --- a/libstdc++-v3/doc/html/index.html +++ b/libstdc++-v3/doc/html/index.html @@ -23,7 +23,7 @@


Table of Contents

The GNU C++ Library Manual
I. Introduction -
1. Status
Implementation Status
C++ 1998/2003
Implementation Status
Implementation Specific Behavior
C++ 2011
Implementation Specific Behavior
C++ 2014
C++ 2017
Implementation Specific Behavior
C++ 202a
Implementation Specific Behavior
C++ TR1
Implementation Specific Behavior
C++ TR 24733
C++ IS 29124
Implementation Specific Behavior
License
The Code: GPL
The Documentation: GPL, FDL
Bugs
Implementation Bugs
Standard Bugs
2. Setup
Prerequisites
Configure
Make
3. Using
Command Options
Headers
Header Files
Mixing Headers
The C Headers and namespace std
Precompiled Headers
Macros
Dual ABI
Troubleshooting
Namespaces
Available Namespaces
namespace std
Using Namespace Composition
Linking
Almost Nothing
Finding Dynamic or Shared Libraries
Experimental Library Extensions
Concurrency
Prerequisites
Thread Safety
Atomics
IO
Structure
Defaults
Future
Alternatives
Containers
Exceptions
Exception Safety
Exception Neutrality
Doing without
Compatibility
With C
With POSIX thread cancellation
Debugging Support
Using g++
Debug Versions of Library Binary Files
Memory Leak Hunting
Data Race Hunting
Using gdb
Tracking uncaught exceptions
Debug Mode
Compile Time Checking
Profile-based Performance Analysis
II. +
1. Status
Implementation Status
C++ 1998/2003
Implementation Status
Implementation Specific Behavior
C++ 2011
Implementation Specific Behavior
C++ 2014
C++ 2017
Implementation Specific Behavior
C++ 202a
Implementation Specific Behavior
C++ TR1
Implementation Specific Behavior
C++ TR 24733
C++ IS 29124
Implementation Specific Behavior
License
The Code: GPL
The Documentation: GPL, FDL
Bugs
Implementation Bugs
Standard Bugs
2. Setup
Prerequisites
Configure
Make
3. Using
Command Options
Headers
Header Files
Mixing Headers
The C Headers and namespace std
Precompiled Headers
Macros
Dual ABI
Troubleshooting
Namespaces
Available Namespaces
namespace std
Using Namespace Composition
Linking
Almost Nothing
Finding Dynamic or Shared Libraries
Experimental Library Extensions
Concurrency
Prerequisites
Thread Safety
Atomics
IO
Structure
Defaults
Future
Alternatives
Containers
Exceptions
Exception Safety
Exception Neutrality
Doing without
Compatibility
With C
With POSIX thread cancellation
Debugging Support
Using g++
Debug Versions of Library Binary Files
Memory Leak Hunting
Non-memory leaks in Pool and MT allocators
Data Race Hunting
Using gdb
Tracking uncaught exceptions
Debug Mode
Compile Time Checking
Profile-based Performance Analysis
II. Standard Contents
4. Support diff --git a/libstdc++-v3/doc/html/manual/api.html b/libstdc++-v3/doc/html/manual/api.html index 363569c9c5a..f9cbad526a8 100644 --- a/libstdc++-v3/doc/html/manual/api.html +++ b/libstdc++-v3/doc/html/manual/api.html @@ -28,11 +28,12 @@ Removal of <ext/tree>, moved to

3.2

Symbol versioning introduced for shared library.

Removal of include <backward/strstream.h>.

Allocator changes. Change __malloc_alloc to malloc_allocator and __new_alloc to new_allocator.

For GCC releases from 2.95 through the 3.1 series, defining __USE_MALLOC on the gcc command line would change the - default allocation strategy to instead use malloc and - free. For the 3.2 and 3.3 release series the same + default allocation strategy to instead use malloc and + free. For the 3.2 and 3.3 release series the same functionality was spelled _GLIBCXX_FORCE_NEW. From - GCC 3.4 onwards the functionality is enabled by setting - GLIBCXX_FORCE_NEW in the environment, see + GCC 3.4 onwards the default allocator uses new anyway, + but for the optional pooling allocators the functionality is enabled by + setting GLIBCXX_FORCE_NEW in the environment, see the mt allocator chapter for details.

Error handling in iostreams cleaned up, made consistent.

3.3

diff --git a/libstdc++-v3/doc/html/manual/backwards.html b/libstdc++-v3/doc/html/manual/backwards.html index 2758f34d858..5116ae94bcd 100644 --- a/libstdc++-v3/doc/html/manual/backwards.html +++ b/libstdc++-v3/doc/html/manual/backwards.html @@ -484,8 +484,9 @@ No stream::attach(int fd) stream-constructor.

An extension is available that implements this. - <ext/stdio_filebuf.h> contains a derived class called - __gnu_cxx::stdio_filebuf. + <ext/stdio_filebuf.h> + contains a derived class called + __gnu_cxx::stdio_filebuf. This class can be constructed from a C FILE* or a file descriptor, and provides the fd() function.

diff --git a/libstdc++-v3/doc/html/manual/debug.html b/libstdc++-v3/doc/html/manual/debug.html index 5e37b0e2476..bce4242cdde 100644 --- a/libstdc++-v3/doc/html/manual/debug.html +++ b/libstdc++-v3/doc/html/manual/debug.html @@ -53,40 +53,28 @@ This quick and dirty approach is often sufficient for quick debugging tasks, when you cannot or don't want to recompile your application to use the debug mode.

Memory Leak Hunting

- There are various third party memory tracing and debug utilities + On many targets GCC supports AddressSanitizer, a fast memory error detector, + which is enabled by the -fsanitize=address option. +

+ There are also various third party memory tracing and debug utilities that can be used to provide detailed memory allocation information about C++ code. An exhaustive list of tools is not going to be attempted, but includes mtrace, valgrind, - mudflap, and the non-free commercial product - purify. In addition, libcwd has a - replacement for the global new and delete operators that can track - memory allocation and deallocation and provide useful memory - statistics. -

- Regardless of the memory debugging tool being used, there is one - thing of great importance to keep in mind when debugging C++ code - that uses new and delete: there are - different kinds of allocation schemes that can be used by - std::allocator. For implementation details, see the mt allocator documentation and - look specifically for GLIBCXX_FORCE_NEW. -

- In a nutshell, the optional mt_allocator - is a high-performance pool allocator, and can - give the mistaken impression that in a suspect executable, memory is - being leaked, when in reality the memory "leak" is a pool being used - by the library's allocator and is reclaimed after program - termination. + mudflap (no longer supported since GCC 4.9.0), ElectricFence, + and the non-free commercial product purify. + In addition, libcwd, jemalloc and TCMalloc have replacements + for the global new and delete operators + that can track memory allocation and deallocation and provide useful + memory statistics.

For valgrind, there are some specific items to keep in mind. First of all, use a version of valgrind that will work with current GNU C++ tools: the first that can do this is valgrind 1.0.4, but later - versions should work at least as well. Second of all, use a - completely unoptimized build to avoid confusing valgrind. Third, use - GLIBCXX_FORCE_NEW to keep extraneous pool allocation noise from - cluttering debug information. + versions should work better. Second, using an unoptimized build + might avoid confusing valgrind.

- Fourth, it may be necessary to force deallocation in other libraries - as well, namely the "C" library. On linux, this can be accomplished + Third, it may be necessary to force deallocation in other libraries + as well, namely the "C" library. On GNU/Linux, this can be accomplished with the appropriate use of the __cxa_atexit or atexit functions.

@@ -121,7 +109,29 @@
   up the runtime environment, library, and test file, might be:
 

    valgrind -v --num-callers=20 --leak-check=yes --leak-resolution=high --show-reachable=yes a.out
-

Data Race Hunting

+

Non-memory leaks in Pool and MT allocators

+ There are different kinds of allocation schemes that can be used by + std::allocator. Prior to GCC 3.4.0 the default was to use + a pooling allocator, pool_allocator, + which is still available as the optional + __pool_alloc extension. + Another optional extension, __mt_alloc, + is a high-performance pool allocator. +

+ In a suspect executable these pooling allocators can give + the mistaken impression that memory is being leaked, + when in reality the memory "leak" is a pool being used + by the library's allocator and is reclaimed after program + termination. +

+ If you're using memory debugging tools on a program that uses + one of these pooling allocators, you can set the environment variable + GLIBCXX_FORCE_NEW to keep extraneous pool allocation + noise from cluttering debug information. + For more details, see the + mt allocator + documentation and look specifically for GLIBCXX_FORCE_NEW. +

Data Race Hunting

All synchronization primitives used in the library internals need to be understood by race detectors so that they do not produce false reports.

diff --git a/libstdc++-v3/doc/html/manual/ext_concurrency_impl.html b/libstdc++-v3/doc/html/manual/ext_concurrency_impl.html index 5fecd4afec0..509c620087b 100644 --- a/libstdc++-v3/doc/html/manual/ext_concurrency_impl.html +++ b/libstdc++-v3/doc/html/manual/ext_concurrency_impl.html @@ -44,7 +44,7 @@ a POSIX-like interface. the current host. In libstdc++ implementation files, <bits/gthr.h> is used to select the proper gthreads file.

Within libstdc++ sources, all calls to underlying thread functionality -use this layer. More detail as to the specific interface can be found in the source documentation. +use this layer. More detail as to the specific interface can be found in the source documentation.

By design, the gthread layer is interoperable with the types, functions, and usage found in the usual <pthread.h> file, including pthread_t, pthread_once_t, pthread_create, diff --git a/libstdc++-v3/doc/html/manual/ext_io.html b/libstdc++-v3/doc/html/manual/ext_io.html index 7e24bedef7f..2959d5d554f 100644 --- a/libstdc++-v3/doc/html/manual/ext_io.html +++ b/libstdc++-v3/doc/html/manual/ext_io.html @@ -34,11 +34,13 @@ library cannot track what you do on your own with a file descriptor, so if you perform any I/O directly, don't expect the library to be aware of it. -

  • Beginning with 3.1, the extra filebuf constructor and +

  • Beginning with 3.1, the extra + basic_filebuf constructor and the fd() function were removed from the standard - filebuf. Instead, <ext/stdio_filebuf.h> contains - a derived class called - __gnu_cxx::stdio_filebuf. + filebuf. Instead, + <ext/stdio_filebuf.h> + contains a derived class template called + __gnu_cxx::stdio_filebuf. This class can be constructed from a C FILE* or a file descriptor, and provides the fd() function.

  • \ No newline at end of file diff --git a/libstdc++-v3/doc/html/manual/index.html b/libstdc++-v3/doc/html/manual/index.html index aeaa9088a1d..f493b275632 100644 --- a/libstdc++-v3/doc/html/manual/index.html +++ b/libstdc++-v3/doc/html/manual/index.html @@ -4,7 +4,7 @@


    Table of Contents

    I. Introduction -
    1. Status
    Implementation Status
    C++ 1998/2003
    Implementation Status
    Implementation Specific Behavior
    C++ 2011
    Implementation Specific Behavior
    C++ 2014
    C++ 2017
    Implementation Specific Behavior
    C++ 202a
    Implementation Specific Behavior
    C++ TR1
    Implementation Specific Behavior
    C++ TR 24733
    C++ IS 29124
    Implementation Specific Behavior
    License
    The Code: GPL
    The Documentation: GPL, FDL
    Bugs
    Implementation Bugs
    Standard Bugs
    2. Setup
    Prerequisites
    Configure
    Make
    3. Using
    Command Options
    Headers
    Header Files
    Mixing Headers
    The C Headers and namespace std
    Precompiled Headers
    Macros
    Dual ABI
    Troubleshooting
    Namespaces
    Available Namespaces
    namespace std
    Using Namespace Composition
    Linking
    Almost Nothing
    Finding Dynamic or Shared Libraries
    Experimental Library Extensions
    Concurrency
    Prerequisites
    Thread Safety
    Atomics
    IO
    Structure
    Defaults
    Future
    Alternatives
    Containers
    Exceptions
    Exception Safety
    Exception Neutrality
    Doing without
    Compatibility
    With C
    With POSIX thread cancellation
    Debugging Support
    Using g++
    Debug Versions of Library Binary Files
    Memory Leak Hunting
    Data Race Hunting
    Using gdb
    Tracking uncaught exceptions
    Debug Mode
    Compile Time Checking
    Profile-based Performance Analysis
    II. +
    1. Status
    Implementation Status
    C++ 1998/2003
    Implementation Status
    Implementation Specific Behavior
    C++ 2011
    Implementation Specific Behavior
    C++ 2014
    C++ 2017
    Implementation Specific Behavior
    C++ 202a
    Implementation Specific Behavior
    C++ TR1
    Implementation Specific Behavior
    C++ TR 24733
    C++ IS 29124
    Implementation Specific Behavior
    License
    The Code: GPL
    The Documentation: GPL, FDL
    Bugs
    Implementation Bugs
    Standard Bugs
    2. Setup
    Prerequisites
    Configure
    Make
    3. Using
    Command Options
    Headers
    Header Files
    Mixing Headers
    The C Headers and namespace std
    Precompiled Headers
    Macros
    Dual ABI
    Troubleshooting
    Namespaces
    Available Namespaces
    namespace std
    Using Namespace Composition
    Linking
    Almost Nothing
    Finding Dynamic or Shared Libraries
    Experimental Library Extensions
    Concurrency
    Prerequisites
    Thread Safety
    Atomics
    IO
    Structure
    Defaults
    Future
    Alternatives
    Containers
    Exceptions
    Exception Safety
    Exception Neutrality
    Doing without
    Compatibility
    With C
    With POSIX thread cancellation
    Debugging Support
    Using g++
    Debug Versions of Library Binary Files
    Memory Leak Hunting
    Non-memory leaks in Pool and MT allocators
    Data Race Hunting
    Using gdb
    Tracking uncaught exceptions
    Debug Mode
    Compile Time Checking
    Profile-based Performance Analysis
    II. Standard Contents
    4. Support diff --git a/libstdc++-v3/doc/html/manual/intro.html b/libstdc++-v3/doc/html/manual/intro.html index f2a4568f0c7..63fc80cefd7 100644 --- a/libstdc++-v3/doc/html/manual/intro.html +++ b/libstdc++-v3/doc/html/manual/intro.html @@ -5,4 +5,4 @@ Prev The GNU C++ Library Manual Next
    \ No newline at end of file + \ No newline at end of file diff --git a/libstdc++-v3/doc/html/manual/parallel_mode_design.html b/libstdc++-v3/doc/html/manual/parallel_mode_design.html index 2e5a0d3bcaa..1d5cbbc99d9 100644 --- a/libstdc++-v3/doc/html/manual/parallel_mode_design.html +++ b/libstdc++-v3/doc/html/manual/parallel_mode_design.html @@ -174,8 +174,8 @@ i. e. it is a singleton. It can be read and written by calling __gnu_parallel::_Settings::set, respectively. Please note that the first call return a const object, so direct manipulation is forbidden. -See - settings.h +See + <parallel/settings.h> for complete details.

    A small example of tuning the default: diff --git a/libstdc++-v3/doc/html/manual/status.html b/libstdc++-v3/doc/html/manual/status.html index 52babbe6120..7e1c1a36dac 100644 --- a/libstdc++-v3/doc/html/manual/status.html +++ b/libstdc++-v3/doc/html/manual/status.html @@ -759,13 +759,14 @@ Feature-testing recommendations for C++. P0031R0 - 7.1 __cpp_lib_array_constexpr >= 201603 The Parallelism TS Should be Standardized + 7.1 __cpp_lib_array_constexpr >= 201603 The Parallelism TS Should be Standardized P0024R2 - No __has_include(<execution>) , + 9.1 __has_include(<execution>) , __cpp_lib_execution >= 201603 , __cpp_lib_parallel_algorithm >= 201603 + (requires linking with -ltbb, see Note 3) An algorithm to "clamp" a value between a pair of boundary values P0025R0 @@ -783,7 +784,7 @@ Feature-testing recommendations for C++. P0226R1 7.1 __cpp_lib_math_special_functions >= 201603 - (see Note 3) + (see Note 4) Adopt the File System TS for C++17 P0218R1 @@ -846,7 +847,11 @@ Note 2: This feature is supported in older releases but the __cpp_lib macro is not defined to the right value (or not defined at all) until the version shown in parentheses.

    -Note 3: The mathematical special functions are enabled in C++17 mode from +Note 3: The Parallel Algorithms have an external dependency on Intel TBB 2018 +or later. If the <execution> +header is included then -ltbb must be used to link to TBB. +

    +Note 4: The mathematical special functions are enabled in C++17 mode from GCC 7.1 onwards. For GCC 6.x or for C++11/C++14 define __STDCPP_WANT_MATH_SPEC_FUNCS__ to a non-zero value and test for __STDCPP_MATH_SPEC_FUNCS__ >= 201003L. @@ -1245,11 +1250,11 @@ Feature-testing recommendations for C++. P0608R3 -   visit<R>: Explicit Return Type for visit +   visit<R>: Explicit Return Type for visit P0655R1 -   std::function move constructor should be noexcept + 9.1   std::function move constructor should be noexcept P0771R1 diff --git a/libstdc++-v3/doc/html/manual/support.html b/libstdc++-v3/doc/html/manual/support.html index 9ed3e5f8cbf..689b35c2b83 100644 --- a/libstdc++-v3/doc/html/manual/support.html +++ b/libstdc++-v3/doc/html/manual/support.html @@ -56,8 +56,8 @@ The header limits defines traits classes to give access to various implementation defined-aspects of the fundamental types. The traits classes -- - fourteen in total -- are all specializations of the template class - numeric_limits, documented here + fourteen in total -- are all specializations of the class template + numeric_limits and defined as follows:

        template<typename T>
    diff --git a/libstdc++-v3/doc/html/manual/using.html b/libstdc++-v3/doc/html/manual/using.html
    index 332725b2aaa..355790d28de 100644
    --- a/libstdc++-v3/doc/html/manual/using.html
    +++ b/libstdc++-v3/doc/html/manual/using.html
    @@ -2,7 +2,7 @@
     Chapter 3. Using

    Chapter 3. Using

    Command Options

    + Next



    \ No newline at end of file + -fopenmpFor parallel mode.-ltbbLinking to tbb (Thread Building Blocks) is required for use of the + Parallel Standard Algorithms and execution policies in + <execution>. +
    \ No newline at end of file diff --git a/libstdc++-v3/doc/xml/manual/status_cxx2017.xml b/libstdc++-v3/doc/xml/manual/status_cxx2017.xml index bb82e34bba7..73403ef6ba0 100644 --- a/libstdc++-v3/doc/xml/manual/status_cxx2017.xml +++ b/libstdc++-v3/doc/xml/manual/status_cxx2017.xml @@ -633,17 +633,18 @@ Feature-testing recommendations for C++. - + The Parallelism TS Should be Standardized P0024R2 - No + 9.1 __has_include(<execution>) , __cpp_lib_execution >= 201603 , __cpp_lib_parallel_algorithm >= 201603 + (requires linking with -ltbb, see Note 3) @@ -689,7 +690,7 @@ Feature-testing recommendations for C++. 7.1 __cpp_lib_math_special_functions >= 201603 - (see Note 3) + (see Note 4) @@ -841,7 +842,13 @@ Note 2: This feature is supported in older releases but the -Note 3: The mathematical special functions are enabled in C++17 mode from +Note 3: The Parallel Algorithms have an external dependency on Intel TBB 2018 +or later. If the <execution> +header is included then -ltbb must be used to link to TBB. + + + +Note 4: The mathematical special functions are enabled in C++17 mode from GCC 7.1 onwards. For GCC 6.x or for C++11/C++14 define __STDCPP_WANT_MATH_SPEC_FUNCS__ to a non-zero value and test for __STDCPP_MATH_SPEC_FUNCS__ >= 201003L. -- 2.30.2