Commit edc61860 authored by Marius Wachtler's avatar Marius Wachtler

Fix compile error with memalloc stats or disabled stats

parent 05fb51ad
...@@ -92,8 +92,8 @@ struct Stats { ...@@ -92,8 +92,8 @@ struct Stats {
static void setEnabled(bool enabled) {} static void setEnabled(bool enabled) {}
static void dump(bool includeZeros = true) { printf("(Stats disabled)\n"); } static void dump(bool includeZeros = true) { printf("(Stats disabled)\n"); }
static void clear() {} static void clear() {}
static void log(int id, int count = 1) {} static void log(uint64_t* counter, int count = 1) {}
static int getStatId(const std::string& name) { return 0; } static uint64_t* getStatCounter(const std::string& name) { return nullptr; }
static void endOfInit() {} static void endOfInit() {}
}; };
struct StatCounter { struct StatCounter {
...@@ -200,8 +200,7 @@ public: ...@@ -200,8 +200,7 @@ public:
}; };
#else #else
struct StatTimer { struct StatTimer {
StatTimer(int statid) {} StatTimer(uint64_t*) {}
StatTimer(int statid, uint64_t at_time) {}
~StatTimer() {} ~StatTimer() {}
bool isPaused() const { return false; } bool isPaused() const { return false; }
......
...@@ -524,8 +524,8 @@ extern "C" PyObject* PystonType_GenericAlloc(BoxedClass* cls, Py_ssize_t nitems) ...@@ -524,8 +524,8 @@ extern "C" PyObject* PystonType_GenericAlloc(BoxedClass* cls, Py_ssize_t nitems)
if (cls->tp_name) { \ if (cls->tp_name) { \
std::string per_name_alloc_name = "alloc." + std::string(cls->tp_name); \ std::string per_name_alloc_name = "alloc." + std::string(cls->tp_name); \
std::string per_name_allocsize_name = "allocsize." + std::string(cls->tp_name); \ std::string per_name_allocsize_name = "allocsize." + std::string(cls->tp_name); \
Stats::log(Stats::getStatId(per_name_alloc_name)); \ Stats::log(Stats::getStatCounter(per_name_alloc_name)); \
Stats::log(Stats::getStatId(per_name_allocsize_name), size); \ Stats::log(Stats::getStatCounter(per_name_allocsize_name), size); \
} }
#define ALLOC_STATS_VAR(cls) \ #define ALLOC_STATS_VAR(cls) \
if (cls->tp_name) { \ if (cls->tp_name) { \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment