Changeset View
Changeset View
Standalone View
Standalone View
src/memusage.h
// Copyright (c) 2015-2016 The Bitcoin Core developers | // Copyright (c) 2015-2016 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#ifndef BITCOIN_MEMUSAGE_H | #ifndef BITCOIN_MEMUSAGE_H | ||||
#define BITCOIN_MEMUSAGE_H | #define BITCOIN_MEMUSAGE_H | ||||
#include "indirectmap.h" | #include <indirectmap.h> | ||||
#include <cstdlib> | #include <cstdlib> | ||||
#include <map> | #include <map> | ||||
#include <set> | #include <set> | ||||
#include <vector> | |||||
#include <unordered_map> | #include <unordered_map> | ||||
#include <unordered_set> | #include <unordered_set> | ||||
#include <vector> | |||||
namespace memusage { | namespace memusage { | ||||
/** Compute the total memory used by allocating alloc bytes. */ | /** Compute the total memory used by allocating alloc bytes. */ | ||||
static size_t MallocUsage(size_t alloc); | static size_t MallocUsage(size_t alloc); | ||||
/** Dynamic memory usage for built-in types is zero. */ | /** Dynamic memory usage for built-in types is zero. */ | ||||
static inline size_t DynamicUsage(const int8_t &v) { | static inline size_t DynamicUsage(const int8_t &v) { | ||||
▲ Show 20 Lines • Show All 158 Lines • Show Last 20 Lines |