1 #ifndef MEMPROF_MIBMAP_H_ 2 #define MEMPROF_MIBMAP_H_ 3 4 #include "memprof_meminfoblock.h" 5 #include "sanitizer_common/sanitizer_addrhashmap.h" 6 #include "sanitizer_common/sanitizer_mutex.h" 7 8 namespace __memprof { 9 10 struct LockedMemInfoBlock { 11 __sanitizer::StaticSpinMutex mutex; 12 MemInfoBlock mib; 13 }; 14 15 // The MIB map stores a mapping from stack ids to MemInfoBlocks. 16 typedef __sanitizer::AddrHashMap<LockedMemInfoBlock *, 200003> MIBMapTy; 17 18 // Insert a new MemInfoBlock or merge with an existing block identified by the 19 // stack id. 20 void InsertOrMerge(const uptr Id, const MemInfoBlock &Block, MIBMapTy &Map); 21 22 } // namespace __memprof 23 24 #endif // MEMPROF_MIBMAP_H_ 25