Remove or replace useless references to <iostream> (#18069)

<iostream> embeds a global constructor (to initialize std::cout and such), typically `static ios_base::Init __ioinit;` in libstdc++).

Replacing it by <istream>, <ostream> (or both) when possible has an impact on the number of global constructors involved (and thus on the number of instructions executed at startup).

Closes #18069

COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/18069 from serge-sans-paille:feature/remove-useless-iostream 42d1458235
PiperOrigin-RevId: 671788440
pull/18151/head
serge-sans-paille 3 months ago committed by Copybara-Service
parent a1b33f4136
commit f803670de7
  1. 2
      src/google/protobuf/compiler/cpp/tools/analyze_profile_proto.cc
  2. 1
      src/google/protobuf/compiler/rust/relative_path.cc
  3. 2
      src/google/protobuf/compiler/subprocess.cc
  4. 1
      src/google/protobuf/descriptor.cc
  5. 1
      src/google/protobuf/descriptor_unittest.cc
  6. 3
      src/google/protobuf/io/zero_copy_stream_impl.cc

@ -10,8 +10,8 @@
#include <algorithm>
#include <cstddef>
#include <cstdint>
#include <iostream>
#include <memory>
#include <ostream>
#include <string>
#include <string_view>
#include <vector>

@ -7,7 +7,6 @@
#include "google/protobuf/compiler/rust/relative_path.h"
#include <iostream>
#include <string>
#include <vector>

@ -11,7 +11,7 @@
#include <algorithm>
#include <cstring>
#include <iostream>
#include <string>
#ifndef _WIN32
#include <errno.h>

@ -22,7 +22,6 @@
#include <cstring>
#include <functional>
#include <initializer_list>
#include <iostream>
#include <iterator>
#include <limits>
#include <memory>

@ -20,7 +20,6 @@
#include <cstdlib>
#include <deque>
#include <functional>
#include <iostream>
#include <limits>
#include <memory>
#include <string>

@ -18,7 +18,8 @@
#include <errno.h>
#include <algorithm>
#include <iostream>
#include <istream>
#include <ostream>
#include "google/protobuf/stubs/common.h"
#include "absl/log/absl_check.h"

Loading…
Cancel
Save