My Project
 All Classes Functions Variables Pages
Memory.h
1 /*
2  * Memory.h
3  *
4  * Created on: Oct 24, 2017
5  * Author: kolban
6  */
7 
8 #ifndef COMPONENTS_CPP_UTILS_MEMORY_H_
9 #define COMPONENTS_CPP_UTILS_MEMORY_H_
10 #include "sdkconfig.h"
11 #ifdef CONFIG_HEAP_TRACING
12 #include <string>
13 extern "C" {
14 #include <esp_heap_trace.h>
15 }
16 
17 class Memory {
18 public:
19  static bool checkIntegrity();
20  static void dump();
21  static void dumpRanges();
22  static void dumpHeapChange(std::string tag);
23  static void init(uint32_t recordCount);
24  static void resumeTrace();
25  static void startTraceAll();
26  static void startTraceLeaks();
27  static void stopTrace();
28 
29 private:
30  static heap_trace_record_t* m_pRecords;
31  static size_t m_lastHeapSize; // Size of last heap recorded.
32 };
33 #endif
34 #endif /* COMPONENTS_CPP_UTILS_MEMORY_H_ */