Electroneum
Loading...
Searching...
No Matches
object_sizes.cpp
Go to the documentation of this file.
1
// Copyright (c) 2017-Present, Electroneum
2
// Copyright (c) 2017-2019, The Monero Project
3
//
4
// All rights reserved.
5
//
6
// Redistribution and use in source and binary forms, with or without modification, are
7
// permitted provided that the following conditions are met:
8
//
9
// 1. Redistributions of source code must retain the above copyright notice, this list of
10
// conditions and the following disclaimer.
11
//
12
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
13
// of conditions and the following disclaimer in the documentation and/or other
14
// materials provided with the distribution.
15
//
16
// 3. Neither the name of the copyright holder nor the names of its contributors may be
17
// used to endorse or promote products derived from this software without specific
18
// prior written permission.
19
//
20
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
21
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
22
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
23
// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
27
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
28
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
30
#include <map>
31
#include "
cryptonote_basic/cryptonote_basic.h
"
32
#include "
cryptonote_basic/tx_extra.h
"
33
#include "
cryptonote_core/cryptonote_core.h
"
34
#include "
cryptonote_core/blockchain.h
"
35
#include "
p2p/p2p_protocol_defs.h
"
36
#include "
net/connection_basic.hpp
"
37
#include "
p2p/net_peerlist.h
"
38
#include "
p2p/net_node.h
"
39
#include "
cryptonote_protocol/cryptonote_protocol_handler.h
"
40
#include "
blockchain_db/lmdb/db_lmdb.h
"
41
#include "
wallet/wallet2.h
"
42
#include "
wallet/api/wallet.h
"
43
#include "
wallet/api/transaction_info.h
"
44
#include "
wallet/api/transaction_history.h
"
45
#include "
wallet/api/unsigned_transaction.h
"
46
#include "
wallet/api/pending_transaction.h
"
47
48
#undef ELECTRONEUM_DEFAULT_LOG_CATEGORY
49
#define ELECTRONEUM_DEFAULT_LOG_CATEGORY "debugtools.objectsizes"
50
51
class
size_logger
52
{
53
public
:
54
~size_logger
()
55
{
56
for
(
const
auto
&i: types)
57
std::cout << std::to_string(i.first) <<
"\t"
<< i.second << std::endl;
58
}
59
void
add
(
const
char
*type,
size_t
size) { types.insert(std::make_pair(size, type)); }
60
private
:
61
std::multimap<size_t, const std::string> types;
62
};
63
#define SL(type) sl.add(#type, sizeof(type))
64
65
int
main
(
int
argc,
char
* argv[])
66
{
67
size_logger
sl;
68
69
tools::on_startup
();
70
71
mlog_configure
(
""
,
true
);
72
73
SL
(boost::thread);
74
SL
(boost::asio::io_service);
75
SL
(boost::asio::io_service::work);
76
SL
(boost::asio::deadline_timer);
77
78
SL
(
cryptonote::DB_ERROR
);
79
SL
(
cryptonote::mdb_txn_safe
);
80
SL
(
cryptonote::mdb_threadinfo
);
81
82
SL
(
cryptonote::block_header
);
83
SL
(
cryptonote::block
);
84
SL
(
cryptonote::transaction_prefix
);
85
SL
(
cryptonote::transaction
);
86
87
SL
(
cryptonote::txpool_tx_meta_t
);
88
89
SL
(
epee::net_utils::ipv4_network_address
);
90
SL
(
epee::net_utils::network_address
);
91
SL
(
epee::net_utils::connection_context_base
);
92
SL
(
epee::net_utils::connection_basic
);
93
94
SL
(
nodetool::peerlist_entry
);
95
SL
(
nodetool::anchor_peerlist_entry
);
96
SL
(
nodetool::node_server
<
cryptonote::t_cryptonote_protocol_handler<cryptonote::core>
>);
97
SL
(
nodetool::p2p_connection_context_t
<
cryptonote::t_cryptonote_protocol_handler<cryptonote::core>::connection_context
>);
98
SL
(
nodetool::network_address_old
);
99
SL
(
nodetool::peerlist_entry_base<nodetool::network_address_old>
);
100
101
SL
(
nodetool::network_config
);
102
SL
(
nodetool::basic_node_data
);
103
SL
(
cryptonote::CORE_SYNC_DATA
);
104
105
SL
(
tools::wallet2::transfer_details
);
106
SL
(
tools::wallet2::payment_details
);
107
SL
(
tools::wallet2::unconfirmed_transfer_details
);
108
SL
(
tools::wallet2::confirmed_transfer_details
);
109
SL
(
tools::wallet2::tx_construction_data
);
110
SL
(
tools::wallet2::pending_tx
);
111
SL
(
tools::wallet2::unsigned_tx_set
);
112
SL
(
tools::wallet2::signed_tx_set
);
113
114
SL
(
Electroneum::WalletImpl
);
115
SL
(
Electroneum::AddressBookRow
);
116
SL
(
Electroneum::TransactionInfoImpl
);
117
SL
(
Electroneum::TransactionHistoryImpl
);
118
SL
(
Electroneum::PendingTransactionImpl
);
119
SL
(
Electroneum::UnsignedTransactionImpl
);
120
121
return
0;
122
}
main
int main()
Definition
archivertest.cpp:283
blockchain.h
Electroneum::PendingTransactionImpl
Definition
pending_transaction.h:43
Electroneum::TransactionHistoryImpl
Definition
transaction_history.h:40
Electroneum::TransactionInfoImpl
Definition
transaction_info.h:41
Electroneum::UnsignedTransactionImpl
Definition
unsigned_transaction.h:43
Electroneum::WalletImpl
Definition
wallet.h:54
cryptonote::DB_ERROR
A generic BlockchainDB exception.
Definition
blockchain_db.h:222
cryptonote::t_cryptonote_protocol_handler
Definition
cryptonote_protocol_handler.h:78
cryptonote::t_cryptonote_protocol_handler::connection_context
cryptonote_connection_context connection_context
Definition
cryptonote_protocol_handler.h:80
cryptonote::transaction_prefix
Definition
cryptonote_basic.h:256
cryptonote::transaction
Definition
cryptonote_basic.h:298
epee::net_utils::connection_basic
Definition
connection_basic.hpp:101
epee::net_utils::ipv4_network_address
Definition
net_utils_base.h:64
epee::net_utils::network_address
Definition
net_utils_base.h:111
nodetool::node_server
Definition
net_node.h:120
size_logger
Definition
object_sizes.cpp:52
size_logger::~size_logger
~size_logger()
Definition
object_sizes.cpp:54
size_logger::add
void add(const char *type, size_t size)
Definition
object_sizes.cpp:59
connection_basic.hpp
base for connection, contains e.g. the ratelimit hooks
cryptonote_basic.h
cryptonote_core.h
cryptonote_protocol_handler.h
This is the orginal cryptonote protocol network-events handler, modified by us.
db_lmdb.h
mlog_configure
void mlog_configure(const std::string &filename_base, bool console, const std::size_t max_log_file_size=MAX_LOG_FILE_SIZE, const std::size_t max_log_files=MAX_LOG_FILES)
Definition
mlog.cpp:148
nodetool::anchor_peerlist_entry
anchor_peerlist_entry_base< epee::net_utils::network_address > anchor_peerlist_entry
Definition
p2p_protocol_defs.h:106
nodetool::peerlist_entry
peerlist_entry_base< epee::net_utils::network_address > peerlist_entry
Definition
p2p_protocol_defs.h:91
tools::on_startup
bool on_startup()
Definition
util.cpp:778
net_node.h
net_peerlist.h
SL
#define SL(type)
Definition
object_sizes.cpp:63
p2p_protocol_defs.h
pending_transaction.h
Electroneum::AddressBookRow
AddressBookRow - provides functions to manage address book.
Definition
wallet2_api.h:216
cryptonote::CORE_SYNC_DATA
Definition
cryptonote_protocol_defs.h:210
cryptonote::block_header
Definition
cryptonote_basic.h:447
cryptonote::block
Definition
cryptonote_basic.h:464
cryptonote::mdb_threadinfo
Definition
db_lmdb.h:132
cryptonote::mdb_txn_safe
Definition
db_lmdb.h:141
cryptonote::txpool_tx_meta_t
a struct containing txpool per transaction metadata
Definition
blockchain_db.h:141
epee::net_utils::connection_context_base
Definition
net_utils_base.h:248
nodetool::basic_node_data
Definition
p2p_protocol_defs.h:165
nodetool::network_address_old
Definition
p2p_protocol_defs.h:63
nodetool::network_config
Definition
p2p_protocol_defs.h:145
nodetool::p2p_connection_context_t
Definition
net_node.h:108
nodetool::peerlist_entry_base
Definition
p2p_protocol_defs.h:75
tools::wallet2::confirmed_transfer_details
Definition
wallet2.h:395
tools::wallet2::payment_details
Definition
wallet2.h:354
tools::wallet2::pending_tx
Definition
wallet2.h:465
tools::wallet2::signed_tx_set
Definition
wallet2.h:504
tools::wallet2::transfer_details
Definition
wallet2.h:302
tools::wallet2::tx_construction_data
Definition
wallet2.h:421
tools::wallet2::unconfirmed_transfer_details
Definition
wallet2.h:379
tools::wallet2::unsigned_tx_set
Definition
wallet2.h:498
transaction_history.h
transaction_info.h
tx_extra.h
unsigned_transaction.h
wallet2.h
wallet.h
src
debug_utilities
object_sizes.cpp
Generated on
for Electroneum by
1.16.1