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

pull MarcoFalke wants to merge 1 commits into bitcoin:master from MarcoFalke:Mf1808-utilFun changing 14 files +44 −36
  1. MarcoFalke commented at 8:13 PM on August 13, 2018: member

    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)

  2. MarcoFalke added the label Refactoring on Aug 13, 2018
  3. MarcoFalke force-pushed on Aug 13, 2018
  4. MarcoFalke force-pushed on Aug 13, 2018
  5. MarcoFalke force-pushed on Aug 13, 2018
  6. MarcoFalke force-pushed on Aug 13, 2018
  7. MarcoFalke commented at 9:06 PM on August 13, 2018: member

    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)

  8. practicalswift commented at 9:20 PM on August 13, 2018: contributor

    Excellent!

    Concept ACK

  9. DrahtBot commented at 9:40 PM on August 13, 2018: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->Note to reviewers: This pull request conflicts with the following ones:

    • #14053 (Add address-based index (attempt 4?) by marcinja)
    • #13389 (Utils and libraries: Fix #13371 - move umask operation earlier in AppInit() by n2yen)
    • #13222 (test: Improve test coverage of SelectCoinsBnB by Empact)

    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.

  10. DrahtBot cross-referenced this on Aug 13, 2018 from issue Remove unused qt nullptr args by Empact
  11. DrahtBot cross-referenced this on Aug 13, 2018 from issue Utils and libraries: Fix #13371 - move umask operation earlier in AppInit() by n2yen
  12. laanwj added this to the "Blockers" column in a project

  13. Empact commented at 7:26 PM on August 23, 2018: member

    utACK fa7db59

  14. in src/util.h:43 in fa7db59dfa outdated
      49 | -
      50 |  extern const char * const BITCOIN_CONF_FILENAME;
      51 |  extern const char * const BITCOIN_PID_FILENAME;
      52 |  
      53 | +/** Translate a message to the native language of the user. */
      54 | +const extern std::function<std::string(const char*)>* G_TRANSLATION_FUN;
    


    promag commented at 10:17 PM on August 23, 2018:

    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?


    MarcoFalke commented at 12:49 PM on August 24, 2018:

    Done

  15. MarcoFalke force-pushed on Aug 24, 2018
  16. util: Replace boost::signals2 with std::function ddddce0e46
  17. MarcoFalke force-pushed on Aug 24, 2018
  18. DrahtBot cross-referenced this on Aug 24, 2018 from issue Add address-based index (attempt 4?) by marcinja
  19. laanwj commented at 7:13 PM on August 25, 2018: member

    utACK ddddce0e46e73d4ca369f2ce9696231cc579e1f9

  20. laanwj merged this on Aug 25, 2018
  21. laanwj closed this on Aug 25, 2018

  22. laanwj referenced this in commit 6f5372a171 on Aug 25, 2018
  23. MarcoFalke deleted the branch on Aug 25, 2018
  24. in src/bench/bench_bitcoin.cpp:16 in ddddce0e46
      12 | @@ -13,6 +13,8 @@
      13 |  
      14 |  #include <memory>
      15 |  
      16 | +const std::function<std::string(const char*)> G_TRANSLATION_FUN = nullptr;
    


    promag commented at 10:32 PM on August 27, 2018:

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

  25. laanwj removed this from the "Blockers" column in a project

  26. Bushstar cross-referenced this on Sep 4, 2018 from issue commits from bitcoin/master by Bushstar
  27. laanwj cross-referenced this on Sep 11, 2018 from issue gui: Also log and print messages or questions like bitcoind by MarcoFalke
  28. ryanofsky cross-referenced this on Sep 26, 2018 from issue Add BitcoinApplication & RPCConsole tests by ryanofsky
  29. ryanofsky cross-referenced this on Jan 7, 2019 from issue Add fee_est tool for debugging fee estimation code by ryanofsky
  30. str4d cross-referenced this on Nov 23, 2020 from issue Backport Boost removal PRs by str4d
  31. zkbot referenced this in commit 77c2a5f810 on Dec 4, 2020
  32. Munkybooty referenced this in commit 6371b139e8 on Jun 28, 2021
  33. Munkybooty referenced this in commit 5ce57423ae on Jun 28, 2021
  34. Munkybooty referenced this in commit 36f6503543 on Jun 28, 2021
  35. Munkybooty referenced this in commit 8904725c02 on Jun 28, 2021
  36. Munkybooty referenced this in commit 8ac2649219 on Jun 29, 2021
  37. Munkybooty referenced this in commit b5e608ad02 on Jun 29, 2021
  38. Munkybooty referenced this in commit e86ea611d4 on Jun 29, 2021
  39. bitcoin locked this on Feb 15, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-20 06:55 UTC