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

util: Replace boost::signals2 with std::function #13961

Merged
merged 1 commit into from Aug 25, 2018

Conversation

maflcko
Copy link
Member

@maflcko maflcko commented Aug 13, 2018

This removes the #include <boost/signals2/signal.hpp> from util.h (hopefully speeding up the build time and reducing the memory usage further after #13634)

The whole translation interface is replaced by a function G_TRANSLATION_FUN that is set to nullptr in units that don't need translation. (Thus only set in the gui)

@maflcko maflcko force-pushed the Mf1808-utilFun branch 4 times, most recently from fa7b6df to fa7db59 Compare August 13, 2018 20:55
@maflcko
Copy link
Member Author

maflcko commented Aug 13, 2018

For all bitcoind units that depend on util:

  • compile time from 1:13 to 0:42
  • compile mem from 407Mb to 389Mb

(gcc default ./configure)

@practicalswift
Copy link
Contributor

Excellent!

Concept ACK

@DrahtBot
Copy link
Contributor

DrahtBot commented Aug 13, 2018

Note to reviewers: This pull request conflicts with the following ones:

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@Empact
Copy link
Member

Empact commented Aug 23, 2018

utACK fa7db59

src/util.h Outdated
extern const char * const BITCOIN_CONF_FILENAME;
extern const char * const BITCOIN_PID_FILENAME;

/** Translate a message to the native language of the user. */
const extern std::function<std::string(const char*)>* G_TRANSLATION_FUN;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about

const extern std::function<std::string(const char*)> G_TRANSLATION_FUN;

And below (L51) use https://en.cppreference.com/w/cpp/utility/functional/function/operator_bool?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@laanwj
Copy link
Member

laanwj commented Aug 25, 2018

utACK ddddce0

@laanwj laanwj merged commit ddddce0 into bitcoin:master Aug 25, 2018
laanwj added a commit that referenced this pull request Aug 25, 2018
ddddce0 util: Replace boost::signals2 with std::function (MarcoFalke)

Pull request description:

  This removes the `#include <boost/signals2/signal.hpp>` from `util.h` (hopefully speeding up the build time and reducing the memory usage further after  #13634)

  The whole translation interface is replaced by a function `G_TRANSLATION_FUN` that is set to nullptr in units that don't need translation. (Thus only set in the gui)

Tree-SHA512: 087c717358bbed8bdb409463e225239d667f1ced381abb10e7cd31a41dcdd2cebe20b43c2ee86f0f8e55d53301f75e963f07421a99a7ff4c0cad2c6a375c5ab1
@maflcko maflcko deleted the Mf1808-utilFun branch August 25, 2018 19:28
@@ -13,6 +13,8 @@

#include <memory>

const std::function<std::string(const char*)> G_TRANSLATION_FUN = nullptr;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These = nullptr are not needed since it's not a pointer and the empty constructor has the same behaviour.

@laanwj laanwj removed this from Blockers in High-priority for review Aug 28, 2018
zkbot added a commit to zcash/zcash that referenced this pull request Dec 4, 2020
Backport Boost removal PRs

Cherry-picked from the following upstream PRs:
- bitcoin/bitcoin#7613
- bitcoin/bitcoin#10502
- bitcoin/bitcoin#10193
- bitcoin/bitcoin#13961
- bitcoin/bitcoin#13734
  - Only the second commit (we don't need the first).
- bitcoin/bitcoin#14480

Part of #4819.
Munkybooty pushed a commit to Munkybooty/dash that referenced this pull request Jun 28, 2021
ddddce0 util: Replace boost::signals2 with std::function (MarcoFalke)

Pull request description:

  This removes the `#include <boost/signals2/signal.hpp>` from `util.h` (hopefully speeding up the build time and reducing the memory usage further after  bitcoin#13634)

  The whole translation interface is replaced by a function `G_TRANSLATION_FUN` that is set to nullptr in units that don't need translation. (Thus only set in the gui)

Tree-SHA512: 087c717358bbed8bdb409463e225239d667f1ced381abb10e7cd31a41dcdd2cebe20b43c2ee86f0f8e55d53301f75e963f07421a99a7ff4c0cad2c6a375c5ab1

# Conflicts:
#	src/bench/bench_dash.cpp
#	src/qt/dash.cpp
#	src/qt/splashscreen.cpp
#	src/qt/transactiontablemodel.cpp
#	src/test/test_dash.cpp
#	src/util/system.h
#	src/wallet/coinselection.cpp
Munkybooty pushed a commit to Munkybooty/dash that referenced this pull request Jun 28, 2021
ddddce0 util: Replace boost::signals2 with std::function (MarcoFalke)

Pull request description:

  This removes the `#include <boost/signals2/signal.hpp>` from `util.h` (hopefully speeding up the build time and reducing the memory usage further after  bitcoin#13634)

  The whole translation interface is replaced by a function `G_TRANSLATION_FUN` that is set to nullptr in units that don't need translation. (Thus only set in the gui)

Tree-SHA512: 087c717358bbed8bdb409463e225239d667f1ced381abb10e7cd31a41dcdd2cebe20b43c2ee86f0f8e55d53301f75e963f07421a99a7ff4c0cad2c6a375c5ab1

# Conflicts:
#	src/bench/bench_dash.cpp
#	src/qt/dash.cpp
#	src/qt/splashscreen.cpp
#	src/qt/transactiontablemodel.cpp
#	src/test/test_dash.cpp
#	src/util/system.h
#	src/wallet/coinselection.cpp
Munkybooty pushed a commit to Munkybooty/dash that referenced this pull request Jun 28, 2021
ddddce0 util: Replace boost::signals2 with std::function (MarcoFalke)

Pull request description:

  This removes the `#include <boost/signals2/signal.hpp>` from `util.h` (hopefully speeding up the build time and reducing the memory usage further after  bitcoin#13634)

  The whole translation interface is replaced by a function `G_TRANSLATION_FUN` that is set to nullptr in units that don't need translation. (Thus only set in the gui)

Tree-SHA512: 087c717358bbed8bdb409463e225239d667f1ced381abb10e7cd31a41dcdd2cebe20b43c2ee86f0f8e55d53301f75e963f07421a99a7ff4c0cad2c6a375c5ab1

# Conflicts:
#	src/bench/bench_dash.cpp
#	src/qt/dash.cpp
#	src/qt/splashscreen.cpp
#	src/qt/transactiontablemodel.cpp
#	src/test/test_dash.cpp
#	src/util/system.h
#	src/wallet/coinselection.cpp
Munkybooty pushed a commit to Munkybooty/dash that referenced this pull request Jun 28, 2021
ddddce0 util: Replace boost::signals2 with std::function (MarcoFalke)

Pull request description:

  This removes the `#include <boost/signals2/signal.hpp>` from `util.h` (hopefully speeding up the build time and reducing the memory usage further after  bitcoin#13634)

  The whole translation interface is replaced by a function `G_TRANSLATION_FUN` that is set to nullptr in units that don't need translation. (Thus only set in the gui)

Tree-SHA512: 087c717358bbed8bdb409463e225239d667f1ced381abb10e7cd31a41dcdd2cebe20b43c2ee86f0f8e55d53301f75e963f07421a99a7ff4c0cad2c6a375c5ab1

# Conflicts:
#	src/bench/bench_dash.cpp
#	src/qt/dash.cpp
#	src/qt/splashscreen.cpp
#	src/qt/transactiontablemodel.cpp
#	src/test/test_dash.cpp
#	src/util/system.h
#	src/wallet/coinselection.cpp
Munkybooty pushed a commit to Munkybooty/dash that referenced this pull request Jun 29, 2021
ddddce0 util: Replace boost::signals2 with std::function (MarcoFalke)

Pull request description:

  This removes the `#include <boost/signals2/signal.hpp>` from `util.h` (hopefully speeding up the build time and reducing the memory usage further after  bitcoin#13634)

  The whole translation interface is replaced by a function `G_TRANSLATION_FUN` that is set to nullptr in units that don't need translation. (Thus only set in the gui)

Tree-SHA512: 087c717358bbed8bdb409463e225239d667f1ced381abb10e7cd31a41dcdd2cebe20b43c2ee86f0f8e55d53301f75e963f07421a99a7ff4c0cad2c6a375c5ab1

# Conflicts:
#	src/bench/bench_dash.cpp
#	src/qt/dash.cpp
#	src/qt/splashscreen.cpp
#	src/qt/transactiontablemodel.cpp
#	src/test/test_dash.cpp
#	src/util/system.h
#	src/wallet/coinselection.cpp
Munkybooty pushed a commit to Munkybooty/dash that referenced this pull request Jun 29, 2021
ddddce0 util: Replace boost::signals2 with std::function (MarcoFalke)

Pull request description:

  This removes the `#include <boost/signals2/signal.hpp>` from `util.h` (hopefully speeding up the build time and reducing the memory usage further after  bitcoin#13634)

  The whole translation interface is replaced by a function `G_TRANSLATION_FUN` that is set to nullptr in units that don't need translation. (Thus only set in the gui)

Tree-SHA512: 087c717358bbed8bdb409463e225239d667f1ced381abb10e7cd31a41dcdd2cebe20b43c2ee86f0f8e55d53301f75e963f07421a99a7ff4c0cad2c6a375c5ab1

# Conflicts:
#	src/bench/bench_dash.cpp
#	src/qt/dash.cpp
#	src/qt/splashscreen.cpp
#	src/qt/transactiontablemodel.cpp
#	src/test/test_dash.cpp
#	src/util/system.h
#	src/wallet/coinselection.cpp
Munkybooty pushed a commit to Munkybooty/dash that referenced this pull request Jun 29, 2021
ddddce0 util: Replace boost::signals2 with std::function (MarcoFalke)

Pull request description:

  This removes the `#include <boost/signals2/signal.hpp>` from `util.h` (hopefully speeding up the build time and reducing the memory usage further after  bitcoin#13634)

  The whole translation interface is replaced by a function `G_TRANSLATION_FUN` that is set to nullptr in units that don't need translation. (Thus only set in the gui)

Tree-SHA512: 087c717358bbed8bdb409463e225239d667f1ced381abb10e7cd31a41dcdd2cebe20b43c2ee86f0f8e55d53301f75e963f07421a99a7ff4c0cad2c6a375c5ab1

# Conflicts:
#	src/bench/bench_dash.cpp
#	src/qt/dash.cpp
#	src/qt/splashscreen.cpp
#	src/qt/transactiontablemodel.cpp
#	src/test/test_dash.cpp
#	src/util/system.h
#	src/wallet/coinselection.cpp
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Feb 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants