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

Reduce the number of global symbols used #15612

Closed
practicalswift opened this issue Mar 17, 2019 · 0 comments · Fixed by #15622
Closed

Reduce the number of global symbols used #15612

practicalswift opened this issue Mar 17, 2019 · 0 comments · Fixed by #15622

Comments

@practicalswift
Copy link
Contributor

practicalswift commented Mar 17, 2019

The bitcoind binary contains more than 79 global symbols as reported by nm (in the BSS data section and initialized data section, somewhat filtered - see oneliner below):

$ for SYMBOL in $(nm src/bitcoind | grep -E ' [BD] ' | c++filt | cut -f3- -d' ' | grep -v @ | grep -v : | sort | grep '[a-z]' | sort -u | grep -vE '^_'); do
     REFERENCES=$(git grep -lE "([^a-zA-Z]|^)${SYMBOL}([^a-zA-Z]|\$)" -- "*.cpp" "*.h")
     N_REFERENCES=$(wc -l <<< "${REFERENCES}")
     echo -n "Found ${N_REFERENCES} use(s) of ${SYMBOL}: "
     sort -u <<< "${REFERENCES}" | tr "\n" " "
     echo
  done
Found 1 use(s) of boundSockets: src/httpserver.cpp
Found 25 use(s) of chainActive: src/bench/block_assemble.cpp src/bench/duplicate_inputs.cpp src/index/base.cpp src/index/txindex.cpp src/init.cpp src/interfaces/chain.cpp src/interfaces/node.cpp src/miner.cpp src/net_processing.cpp src/policy/fees.cpp src/qt/test/wallettests.cpp src/rest.cpp src/rpc/blockchain.cpp src/rpc/mining.cpp src/rpc/rawtransaction.cpp src/test/denialofservice_tests.cpp src/test/miner_tests.cpp src/test/test_bitcoin.cpp src/test/txvalidationcache_tests.cpp src/test/validation_block_tests.cpp src/txmempool.h src/validation.cpp src/validation.h src/wallet/test/wallet_tests.cpp src/wallet/wallet.cpp
Found 43 use(s) of cs_main: src/bench/block_assemble.cpp src/bench/duplicate_inputs.cpp src/bench/mempool_eviction.cpp src/bench/rpc_mempool.cpp src/index/base.cpp src/index/txindex.cpp src/init.cpp src/interfaces/chain.cpp src/interfaces/node.cpp src/interfaces/wallet.cpp src/miner.cpp src/net.h src/net_processing.cpp src/net_processing.h src/node/transaction.cpp src/qt/clientmodel.cpp src/qt/peertablemodel.cpp src/rest.cpp src/rpc/blockchain.cpp src/rpc/mining.cpp src/rpc/misc.cpp src/rpc/net.cpp src/rpc/rawtransaction.cpp src/test/blockencodings_tests.cpp src/test/denialofservice_tests.cpp src/test/mempool_tests.cpp src/test/miner_tests.cpp src/test/policyestimator_tests.cpp src/test/script_p2sh_tests.cpp src/test/test_bitcoin.cpp src/test/transaction_tests.cpp src/test/txvalidationcache_tests.cpp src/test/txvalidation_tests.cpp src/test/validation_block_tests.cpp src/txmempool.h src/validation.cpp src/validation.h src/validationinterface.cpp src/validationinterface.h src/wallet/test/wallet_tests.cpp src/wallet/wallet.cpp src/wallet/wallet.h src/zmq/zmqpublishnotifier.cpp
Found 4 use(s) of cs_mapLocalHost: src/net.cpp src/net.h src/rpc/net.cpp src/test/net_tests.cpp
Found 1 use(s) of cs_warnings: src/warnings.cpp
Found 7 use(s) of dustRelayFee: src/init.cpp src/interfaces/node.cpp src/policy/policy.cpp src/policy/policy.h src/test/transaction_tests.cpp src/wallet/fees.cpp src/wallet/wallet.cpp
Found 1 use(s) of eventHTTP: src/httpserver.cpp
Found 4 use(s) of fAcceptDatacarrier: src/init.cpp src/policy/policy.cpp src/script/standard.cpp src/script/standard.h
Found 4 use(s) of fCheckBlockIndex: src/init.cpp src/test/test_bitcoin.cpp src/validation.cpp src/validation.h
Found 4 use(s) of fCheckpointsEnabled: src/init.cpp src/test/miner_tests.cpp src/validation.cpp src/validation.h
Found 3 use(s) of fDiscover: src/init.cpp src/net.cpp src/net.h
Found 6 use(s) of feeEstimator: src/init.cpp src/interfaces/chain.cpp src/interfaces/node.cpp src/rpc/mining.cpp src/validation.cpp src/validation.h
Found 3 use(s) of fEnableReplacement: src/init.cpp src/validation.cpp src/validation.h
Found 1 use(s) of fFeeEstimatesInitialized: src/init.cpp
Found 3 use(s) of fHavePruned: src/init.cpp src/validation.cpp src/validation.h
Found 5 use(s) of fImporting: src/init.cpp src/interfaces/node.cpp src/net_processing.cpp src/validation.cpp src/validation.h
Found 4 use(s) of fIsBareMultisigStd: src/init.cpp src/policy/policy.cpp src/validation.cpp src/validation.h
Found 1 use(s) of fLargeWorkForkFound: src/warnings.cpp
Found 1 use(s) of fLargeWorkInvalidChainFound: src/warnings.cpp
Found 5 use(s) of fListen: src/init.cpp src/net.cpp src/net.h src/net_processing.cpp src/qt/optionsmodel.cpp
Found 6 use(s) of fLogIPs: src/init.cpp src/logging.cpp src/logging.h src/net.cpp src/net_processing.cpp src/rpc/server.cpp
Found 4 use(s) of fNameLookup: src/init.cpp src/netbase.cpp src/netbase.h src/net.cpp
Found 6 use(s) of fPruneMode: src/init.cpp src/interfaces/chain.cpp src/net_processing.cpp src/rpc/blockchain.cpp src/validation.cpp src/validation.h
Found 5 use(s) of fReindex: src/init.cpp src/interfaces/node.cpp src/net_processing.cpp src/validation.cpp src/validation.h
Found 5 use(s) of fRelayTxes: src/init.cpp src/net.cpp src/net.h src/net_processing.cpp src/rpc/net.cpp
Found 5 use(s) of fRequireStandard: src/chainparams.cpp src/chainparams.h src/init.cpp src/validation.cpp src/validation.h
Found 51 use(s) of gArgs: src/bench/bench_bitcoin.cpp src/bitcoin-cli.cpp src/bitcoind.cpp src/bitcoin-tx.cpp src/bitcoin-wallet.cpp src/chainparamsbase.cpp src/chainparams.cpp src/dbwrapper.cpp src/dummywallet.cpp src/httprpc.cpp src/httpserver.cpp src/init.cpp src/init.h src/interfaces/chain.cpp src/interfaces/node.cpp src/miner.cpp src/net.cpp src/net_processing.cpp src/qt/bitcoin.cpp src/qt/guiutil.cpp src/qt/intro.cpp src/qt/optionsmodel.cpp src/qt/paymentrequestplus.cpp src/qt/paymentserver.cpp src/qt/test/test_main.cpp src/qt/utilitydialog.cpp src/qt/walletmodel.cpp src/rpc/blockchain.cpp src/rpc/protocol.cpp src/rpc/server.cpp src/script/sigcache.cpp src/test/denialofservice_tests.cpp src/test/getarg_tests.cpp src/test/net_tests.cpp src/test/test_bitcoin.cpp src/timedata.cpp src/torcontrol.cpp src/txdb.cpp src/util/system.cpp src/util/system.h src/validation.cpp src/wallet/coincontrol.cpp src/wallet/db.cpp src/wallet/feebumper.cpp src/wallet/init.cpp src/wallet/test/init_test_fixture.cpp src/wallet/test/init_tests.cpp src/wallet/wallet.cpp src/wallet/walletdb.cpp src/wallet/walletutil.cpp src/zmq/zmqnotificationinterface.cpp
Found 6 use(s) of g_banman: src/banman.h src/init.cpp src/interfaces/node.cpp src/net.h src/rpc/net.cpp src/test/test_bitcoin.cpp
Found 4 use(s) of g_best_block: src/init.cpp src/rpc/mining.cpp src/validation.cpp src/validation.h
Found 4 use(s) of g_best_block_cv: src/init.cpp src/rpc/mining.cpp src/validation.cpp src/validation.h
Found 3 use(s) of g_best_block_mutex: src/rpc/mining.cpp src/validation.cpp src/validation.h
Found 1 use(s) of g_chainstate: src/validation.cpp
Found 8 use(s) of g_connman: src/init.cpp src/interfaces/chain.cpp src/interfaces/node.cpp src/net.h src/node/transaction.cpp src/rpc/mining.cpp src/rpc/net.cpp src/test/test_bitcoin.cpp
Found 3 use(s) of g_cs_orphans: src/net.h src/net_processing.cpp src/test/denialofservice_tests.cpp
Found 4 use(s) of g_is_mempool_loaded: src/init.cpp src/rpc/blockchain.cpp src/validation.cpp src/validation.h
Found 4 use(s) of g_mock_deterministic_tests: src/random.cpp src/test/bloom_tests.cpp src/test/random_tests.cpp src/test/test_bitcoin.h
Found 6 use(s) of g_rpc_interfaces: src/init.cpp src/rpc/rawtransaction.cpp src/rpc/util.cpp src/rpc/util.h src/test/rpc_tests.cpp src/wallet/rpcwallet.cpp
Found 7 use(s) of g_txindex: src/index/txindex.cpp src/index/txindex.h src/init.cpp src/rest.cpp src/rpc/blockchain.cpp src/rpc/rawtransaction.cpp src/validation.cpp
Found 1 use(s) of g_ui_signals: src/ui_interface.cpp
Found 5 use(s) of g_wallet_init_interface: src/dummywallet.cpp src/httprpc.cpp src/init.cpp src/wallet/init.cpp src/walletinitinterface.h
Found 4 use(s) of g_zmq_notification_interface: src/init.cpp src/zmq/zmqnotificationinterface.cpp src/zmq/zmqnotificationinterface.h src/zmq/zmqrpc.cpp
Found 3 use(s) of hashAssumeValid: src/init.cpp src/validation.cpp src/validation.h
Found 8 use(s) of incrementalRelayFee: src/init.cpp src/policy/policy.cpp src/policy/policy.h src/rpc/net.cpp src/txmempool.cpp src/txmempool.h src/validation.cpp src/wallet/feebumper.cpp
Found 1 use(s) of instance_of_cmaincleanup: src/validation.cpp
Found 1 use(s) of instance_of_cnetcleanup: src/net.cpp
Found 1 use(s) of instance_of_cnetprocessingcleanup: src/net_processing.cpp
Found 8 use(s) of mapBlockIndex: src/init.cpp src/interfaces/wallet.cpp src/net_processing.cpp src/rpc/blockchain.cpp src/txdb.cpp src/validation.cpp src/validation.h src/wallet/test/wallet_tests.cpp
Found 4 use(s) of mapLocalHost: src/net.cpp src/net.h src/rpc/net.cpp src/test/net_tests.cpp
Found 2 use(s) of mapOrphanTransactions: src/net_processing.cpp src/test/denialofservice_tests.cpp
Found 11 use(s) of maxTxFee: src/init.cpp src/interfaces/chain.cpp src/interfaces/chain.h src/interfaces/node.cpp src/qt/walletmodel.cpp src/rpc/rawtransaction.cpp src/validation.cpp src/validation.h src/wallet/feebumper.cpp src/wallet/fees.cpp src/wallet/wallet.cpp
Found 55 use(s) of mempool: src/bench/block_assemble.cpp src/bench/mempool_eviction.cpp src/blockencodings.cpp src/blockencodings.h src/init.cpp src/interfaces/chain.cpp src/interfaces/chain.h src/interfaces/node.cpp src/interfaces/node.h src/interfaces/wallet.cpp src/interfaces/wallet.h src/logging.cpp src/miner.cpp src/miner.h src/net.h src/net_processing.cpp src/node/transaction.cpp src/policy/fees.cpp src/policy/fees.h src/policy/policy.h src/policy/rbf.cpp src/policy/rbf.h src/protocol.cpp src/protocol.h src/qt/bitcoinstrings.cpp src/qt/coincontroldialog.cpp src/qt/rpcconsole.h src/qt/test/rpcnestedtests.cpp src/qt/transactionrecord.h src/rest.cpp src/rpc/blockchain.cpp src/rpc/client.cpp src/rpc/mining.cpp src/rpc/misc.cpp src/rpc/net.cpp src/rpc/rawtransaction.cpp src/test/blockencodings_tests.cpp src/test/mempool_tests.cpp src/test/miner_tests.cpp src/test/policyestimator_tests.cpp src/test/test_bitcoin.cpp src/test/txvalidationcache_tests.cpp src/test/txvalidation_tests.cpp src/txmempool.cpp src/txmempool.h src/validation.cpp src/validation.h src/validationinterface.h src/wallet/feebumper.cpp src/wallet/feebumper.h src/wallet/fees.cpp src/wallet/init.cpp src/wallet/rpcwallet.cpp src/wallet/wallet.cpp src/wallet/wallet.h
Found 11 use(s) of minRelayTxFee: src/init.cpp src/net_processing.cpp src/policy/policy.h src/rpc/blockchain.cpp src/rpc/net.cpp src/validation.cpp src/validation.h src/wallet/fees.cpp src/wallet/init.cpp src/wallet/rpcwallet.cpp src/wallet/wallet.cpp
Found 3 use(s) of nBytesPerSigOp: src/init.cpp src/policy/policy.cpp src/policy/policy.h
Found 3 use(s) of nCoinCacheUsage: src/init.cpp src/validation.cpp src/validation.h
Found 4 use(s) of nConnectTimeout: src/init.cpp src/netbase.cpp src/netbase.h src/net.cpp
Found 4 use(s) of nMaxDatacarrierBytes: src/init.cpp src/policy/policy.cpp src/script/standard.cpp src/script/standard.h
Found 3 use(s) of nMaxTipAge: src/init.cpp src/validation.cpp src/validation.h
Found 6 use(s) of nMinimumChainWork: src/chainparams.cpp src/consensus/params.h src/init.cpp src/net_processing.cpp src/validation.cpp src/validation.h
Found 4 use(s) of nPruneTarget: src/init.cpp src/rpc/blockchain.cpp src/validation.cpp src/validation.h
Found 5 use(s) of nScriptCheckThreads: src/init.cpp src/test/checkqueue_tests.cpp src/test/test_bitcoin.cpp src/validation.cpp src/validation.h
Found 13 use(s) of NullUniValue: src/bitcoin-cli.cpp src/httprpc.cpp src/rpc/blockchain.cpp src/rpc/mining.cpp src/rpc/misc.cpp src/rpc/net.cpp src/rpc/protocol.cpp src/rpc/server.cpp src/rpc/server.h src/univalue/include/univalue.h src/univalue/lib/univalue.cpp src/wallet/rpcdump.cpp src/wallet/rpcwallet.cpp
Found 1 use(s) of pathHandlers: src/httpserver.cpp
Found 7 use(s) of pblocktree: src/bench/block_assemble.cpp src/bench/duplicate_inputs.cpp src/index/txindex.cpp src/init.cpp src/test/test_bitcoin.cpp src/validation.cpp src/validation.h
Found 7 use(s) of pcoinsdbview: src/bench/block_assemble.cpp src/bench/duplicate_inputs.cpp src/init.cpp src/rpc/blockchain.cpp src/test/test_bitcoin.cpp src/validation.cpp src/validation.h
Found 15 use(s) of pcoinsTip: src/bench/block_assemble.cpp src/bench/duplicate_inputs.cpp src/init.cpp src/interfaces/node.cpp src/net_processing.cpp src/node/transaction.cpp src/rest.cpp src/rpc/blockchain.cpp src/rpc/rawtransaction.cpp src/test/miner_tests.cpp src/test/test_bitcoin.cpp src/test/txvalidationcache_tests.cpp src/txmempool.h src/validation.cpp src/validation.h
Found 2 use(s) of peerLogic: src/init.cpp src/test/denialofservice_tests.cpp
Found 1 use(s) of pindexBestForkBase: src/validation.cpp
Found 1 use(s) of pindexBestForkTip: src/validation.cpp
Found 5 use(s) of pindexBestHeader: src/interfaces/node.cpp src/net_processing.cpp src/rpc/blockchain.cpp src/validation.cpp src/validation.h
Found 3 use(s) of secp256k1_nonce_function_default: src/secp256k1/include/secp256k1.h src/secp256k1/include/secp256k1_recovery.h src/secp256k1/src/modules/recovery/main_impl.h
Found 2 use(s) of secp256k1_nonce_function_rfc6979: src/key.cpp src/secp256k1/include/secp256k1.h
Found 11 use(s) of tableRPC: src/httprpc.cpp src/init.cpp src/interfaces/node.cpp src/interfaces/wallet.cpp src/qt/test/rpcnestedtests.cpp src/rpc/register.h src/rpc/server.cpp src/rpc/server.h src/test/rpc_tests.cpp src/test/test_bitcoin.cpp src/wallet/test/wallet_test_fixture.cpp
Found 1 use(s) of threadHTTP: src/httpserver.cpp
Found 17 use(s) of uiInterface: src/httprpc.cpp src/httpserver.cpp src/index/base.cpp src/index/txindex.cpp src/init.cpp src/interfaces/chain.cpp src/interfaces/node.cpp src/net.cpp src/net.h src/noui.cpp src/timedata.cpp src/txdb.cpp src/ui_interface.cpp src/ui_interface.h src/validation.cpp src/wallet/init.cpp src/wallet/rpcdump.cpp
Found 3 use(s) of versionbitscache: src/rpc/mining.cpp src/validation.cpp src/validation.h
Found 6 use(s) of VersionBitsDeploymentInfo: src/chainparams.cpp src/consensus/params.h src/rpc/blockchain.cpp src/rpc/mining.cpp src/versionbitsinfo.cpp src/versionbitsinfo.h
$ for SYMBOL in $(nm src/bitcoind | c++filt | grep -E ' B .*[a-z]\[abi:cxx11\]' | cut -f3- -d' ' | cut -f1 -d'[' | sort -u); do
       REFERENCES=$(git grep -lE "([^a-zA-Z]|^)${SYMBOL}([^a-zA-Z]|\$)" -- "*.cpp" "*.h")
       N_REFERENCES=$(wc -l <<< "${REFERENCES}")
       echo -n "Found ${N_REFERENCES} use(s) of ${SYMBOL}: "
       sort -u <<< "${REFERENCES}" | tr "\n" " "
       echo
  done
Found 5 use(s) of strMessageMagic: src/qt/signverifymessagedialog.cpp src/rpc/misc.cpp src/validation.cpp src/validation.h src/wallet/rpcwallet.cpp
Found 1 use(s) of strMiscWarning: src/warnings.cpp
Found 6 use(s) of strSubVersion: src/init.cpp src/net.cpp src/net.h src/net_processing.cpp src/qt/clientmodel.cpp src/rpc/net.cpp

Most of these symbols are global (external) for good reasons.

However, judging from the output above the following 16 symbols do not have to be global (external):

Found 1 use(s) of boundSockets: src/httpserver.cpp
Found 1 use(s) of cs_warnings: src/warnings.cpp
Found 1 use(s) of eventHTTP: src/httpserver.cpp
Found 1 use(s) of fFeeEstimatesInitialized: src/init.cpp
Found 1 use(s) of fLargeWorkForkFound: src/warnings.cpp
Found 1 use(s) of fLargeWorkInvalidChainFound: src/warnings.cpp
Found 1 use(s) of g_chainstate: src/validation.cpp
Found 1 use(s) of g_ui_signals: src/ui_interface.cpp
Found 1 use(s) of instance_of_cmaincleanup: src/validation.cpp
Found 1 use(s) of instance_of_cnetcleanup: src/net.cpp
Found 1 use(s) of instance_of_cnetprocessingcleanup: src/net_processing.cpp
Found 1 use(s) of pathHandlers: src/httpserver.cpp
Found 1 use(s) of pindexBestForkBase: src/validation.cpp
Found 1 use(s) of pindexBestForkTip: src/validation.cpp
Found 1 use(s) of strMiscWarning: src/warnings.cpp
Found 1 use(s) of threadHTTP: src/httpserver.cpp
@practicalswift practicalswift changed the title Reduce the number of globals used Reduce the number of global symbols used Apr 16, 2019
maflcko pushed a commit that referenced this issue May 25, 2019
… if possible

fb43415 Remove global symbols: Avoid using the global namespace if possible (practicalswift)

Pull request description:

  Remove global symbols: Avoid using the global namespace if possible.

  Partially resolves #15612 ("Reduce the number of global symbols used").

  Change in global symbols as reported by `nm bitcoind` before vs after:

  ```
  $ diff -u <(nm src/bitcoind-before | c++filt | grep -E '^[0-9a-f]+ [A-Z] ' | cut -f3- -d' ' | sort -u) \
            <(nm src/bitcoind-after  | c++filt | grep -E '^[0-9a-f]+ [A-Z] ' | cut -f3- -d' ' | sort -u) \
            | grep -E '^[+-][^+-]'
  -boundSockets
  -cs_warnings
  -eventHTTP
  -fFeeEstimatesInitialized
  -fLargeWorkForkFound
  -fLargeWorkInvalidChainFound
  -pathHandlers
  -strMiscWarning[abi:cxx11]
  -threadHTTP
  ```

ACKs for commit fb4341:

Tree-SHA512: d2f78f6188a992b0e0de8d107e2c494cfa0faa2de4fda634a1d3606d6515633bec86289cf2a2e78ffe467b17b795e2243cc459fb44e0dfe2fc69899506ff61c9
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this issue Jun 27, 2021
…mespace if possible

fb43415 Remove global symbols: Avoid using the global namespace if possible (practicalswift)

Pull request description:

  Remove global symbols: Avoid using the global namespace if possible.

  Partially resolves bitcoin#15612 ("Reduce the number of global symbols used").

  Change in global symbols as reported by `nm bitcoind` before vs after:

  ```
  $ diff -u <(nm src/bitcoind-before | c++filt | grep -E '^[0-9a-f]+ [A-Z] ' | cut -f3- -d' ' | sort -u) \
            <(nm src/bitcoind-after  | c++filt | grep -E '^[0-9a-f]+ [A-Z] ' | cut -f3- -d' ' | sort -u) \
            | grep -E '^[+-][^+-]'
  -boundSockets
  -cs_warnings
  -eventHTTP
  -fFeeEstimatesInitialized
  -fLargeWorkForkFound
  -fLargeWorkInvalidChainFound
  -pathHandlers
  -strMiscWarning[abi:cxx11]
  -threadHTTP
  ```

ACKs for commit fb4341:

Tree-SHA512: d2f78f6188a992b0e0de8d107e2c494cfa0faa2de4fda634a1d3606d6515633bec86289cf2a2e78ffe467b17b795e2243cc459fb44e0dfe2fc69899506ff61c9
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this issue Jun 28, 2021
…mespace if possible

fb43415 Remove global symbols: Avoid using the global namespace if possible (practicalswift)

Pull request description:

  Remove global symbols: Avoid using the global namespace if possible.

  Partially resolves bitcoin#15612 ("Reduce the number of global symbols used").

  Change in global symbols as reported by `nm bitcoind` before vs after:

  ```
  $ diff -u <(nm src/bitcoind-before | c++filt | grep -E '^[0-9a-f]+ [A-Z] ' | cut -f3- -d' ' | sort -u) \
            <(nm src/bitcoind-after  | c++filt | grep -E '^[0-9a-f]+ [A-Z] ' | cut -f3- -d' ' | sort -u) \
            | grep -E '^[+-][^+-]'
  -boundSockets
  -cs_warnings
  -eventHTTP
  -fFeeEstimatesInitialized
  -fLargeWorkForkFound
  -fLargeWorkInvalidChainFound
  -pathHandlers
  -strMiscWarning[abi:cxx11]
  -threadHTTP
  ```

ACKs for commit fb4341:

Tree-SHA512: d2f78f6188a992b0e0de8d107e2c494cfa0faa2de4fda634a1d3606d6515633bec86289cf2a2e78ffe467b17b795e2243cc459fb44e0dfe2fc69899506ff61c9
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this issue Jun 29, 2021
…mespace if possible

fb43415 Remove global symbols: Avoid using the global namespace if possible (practicalswift)

Pull request description:

  Remove global symbols: Avoid using the global namespace if possible.

  Partially resolves bitcoin#15612 ("Reduce the number of global symbols used").

  Change in global symbols as reported by `nm bitcoind` before vs after:

  ```
  $ diff -u <(nm src/bitcoind-before | c++filt | grep -E '^[0-9a-f]+ [A-Z] ' | cut -f3- -d' ' | sort -u) \
            <(nm src/bitcoind-after  | c++filt | grep -E '^[0-9a-f]+ [A-Z] ' | cut -f3- -d' ' | sort -u) \
            | grep -E '^[+-][^+-]'
  -boundSockets
  -cs_warnings
  -eventHTTP
  -fFeeEstimatesInitialized
  -fLargeWorkForkFound
  -fLargeWorkInvalidChainFound
  -pathHandlers
  -strMiscWarning[abi:cxx11]
  -threadHTTP
  ```

ACKs for commit fb4341:

Tree-SHA512: d2f78f6188a992b0e0de8d107e2c494cfa0faa2de4fda634a1d3606d6515633bec86289cf2a2e78ffe467b17b795e2243cc459fb44e0dfe2fc69899506ff61c9
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this issue Sep 11, 2021
…mespace if possible

fb43415 Remove global symbols: Avoid using the global namespace if possible (practicalswift)

Pull request description:

  Remove global symbols: Avoid using the global namespace if possible.

  Partially resolves bitcoin#15612 ("Reduce the number of global symbols used").

  Change in global symbols as reported by `nm bitcoind` before vs after:

  ```
  $ diff -u <(nm src/bitcoind-before | c++filt | grep -E '^[0-9a-f]+ [A-Z] ' | cut -f3- -d' ' | sort -u) \
            <(nm src/bitcoind-after  | c++filt | grep -E '^[0-9a-f]+ [A-Z] ' | cut -f3- -d' ' | sort -u) \
            | grep -E '^[+-][^+-]'
  -boundSockets
  -cs_warnings
  -eventHTTP
  -fFeeEstimatesInitialized
  -fLargeWorkForkFound
  -fLargeWorkInvalidChainFound
  -pathHandlers
  -strMiscWarning[abi:cxx11]
  -threadHTTP
  ```

ACKs for commit fb4341:

Tree-SHA512: d2f78f6188a992b0e0de8d107e2c494cfa0faa2de4fda634a1d3606d6515633bec86289cf2a2e78ffe467b17b795e2243cc459fb44e0dfe2fc69899506ff61c9
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this issue Sep 11, 2021
…mespace if possible

fb43415 Remove global symbols: Avoid using the global namespace if possible (practicalswift)

Pull request description:

  Remove global symbols: Avoid using the global namespace if possible.

  Partially resolves bitcoin#15612 ("Reduce the number of global symbols used").

  Change in global symbols as reported by `nm bitcoind` before vs after:

  ```
  $ diff -u <(nm src/bitcoind-before | c++filt | grep -E '^[0-9a-f]+ [A-Z] ' | cut -f3- -d' ' | sort -u) \
            <(nm src/bitcoind-after  | c++filt | grep -E '^[0-9a-f]+ [A-Z] ' | cut -f3- -d' ' | sort -u) \
            | grep -E '^[+-][^+-]'
  -boundSockets
  -cs_warnings
  -eventHTTP
  -fFeeEstimatesInitialized
  -fLargeWorkForkFound
  -fLargeWorkInvalidChainFound
  -pathHandlers
  -strMiscWarning[abi:cxx11]
  -threadHTTP
  ```

ACKs for commit fb4341:

Tree-SHA512: d2f78f6188a992b0e0de8d107e2c494cfa0faa2de4fda634a1d3606d6515633bec86289cf2a2e78ffe467b17b795e2243cc459fb44e0dfe2fc69899506ff61c9
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this issue Sep 12, 2021
…mespace if possible

fb43415 Remove global symbols: Avoid using the global namespace if possible (practicalswift)

Pull request description:

  Remove global symbols: Avoid using the global namespace if possible.

  Partially resolves bitcoin#15612 ("Reduce the number of global symbols used").

  Change in global symbols as reported by `nm bitcoind` before vs after:

  ```
  $ diff -u <(nm src/bitcoind-before | c++filt | grep -E '^[0-9a-f]+ [A-Z] ' | cut -f3- -d' ' | sort -u) \
            <(nm src/bitcoind-after  | c++filt | grep -E '^[0-9a-f]+ [A-Z] ' | cut -f3- -d' ' | sort -u) \
            | grep -E '^[+-][^+-]'
  -boundSockets
  -cs_warnings
  -eventHTTP
  -fFeeEstimatesInitialized
  -fLargeWorkForkFound
  -fLargeWorkInvalidChainFound
  -pathHandlers
  -strMiscWarning[abi:cxx11]
  -threadHTTP
  ```

ACKs for commit fb4341:

Tree-SHA512: d2f78f6188a992b0e0de8d107e2c494cfa0faa2de4fda634a1d3606d6515633bec86289cf2a2e78ffe467b17b795e2243cc459fb44e0dfe2fc69899506ff61c9
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Dec 16, 2021
gades pushed a commit to cosanta/cosanta-core that referenced this issue Jun 18, 2023
…mespace if possible

fb43415 Remove global symbols: Avoid using the global namespace if possible (practicalswift)

Pull request description:

  Remove global symbols: Avoid using the global namespace if possible.

  Partially resolves bitcoin#15612 ("Reduce the number of global symbols used").

  Change in global symbols as reported by `nm bitcoind` before vs after:

  ```
  $ diff -u <(nm src/bitcoind-before | c++filt | grep -E '^[0-9a-f]+ [A-Z] ' | cut -f3- -d' ' | sort -u) \
            <(nm src/bitcoind-after  | c++filt | grep -E '^[0-9a-f]+ [A-Z] ' | cut -f3- -d' ' | sort -u) \
            | grep -E '^[+-][^+-]'
  -boundSockets
  -cs_warnings
  -eventHTTP
  -fFeeEstimatesInitialized
  -fLargeWorkForkFound
  -fLargeWorkInvalidChainFound
  -pathHandlers
  -strMiscWarning[abi:cxx11]
  -threadHTTP
  ```

ACKs for commit fb4341:

Tree-SHA512: d2f78f6188a992b0e0de8d107e2c494cfa0faa2de4fda634a1d3606d6515633bec86289cf2a2e78ffe467b17b795e2243cc459fb44e0dfe2fc69899506ff61c9
gades pushed a commit to piratecash/pirate that referenced this issue Dec 9, 2023
…mespace if possible

fb43415 Remove global symbols: Avoid using the global namespace if possible (practicalswift)

Pull request description:

  Remove global symbols: Avoid using the global namespace if possible.

  Partially resolves bitcoin#15612 ("Reduce the number of global symbols used").

  Change in global symbols as reported by `nm bitcoind` before vs after:

  ```
  $ diff -u <(nm src/bitcoind-before | c++filt | grep -E '^[0-9a-f]+ [A-Z] ' | cut -f3- -d' ' | sort -u) \
            <(nm src/bitcoind-after  | c++filt | grep -E '^[0-9a-f]+ [A-Z] ' | cut -f3- -d' ' | sort -u) \
            | grep -E '^[+-][^+-]'
  -boundSockets
  -cs_warnings
  -eventHTTP
  -fFeeEstimatesInitialized
  -fLargeWorkForkFound
  -fLargeWorkInvalidChainFound
  -pathHandlers
  -strMiscWarning[abi:cxx11]
  -threadHTTP
  ```

ACKs for commit fb4341:

Tree-SHA512: d2f78f6188a992b0e0de8d107e2c494cfa0faa2de4fda634a1d3606d6515633bec86289cf2a2e78ffe467b17b795e2243cc459fb44e0dfe2fc69899506ff61c9
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants