MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / remove

Method remove

src/core/test/mem_alloc.cpp:129–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127 }
128
129 void remove(void* addr) {
130 MGB_LOCK_GUARD(m_mtx);
131 auto iter = m_addr2size.find(reinterpret_cast<size_t>(addr));
132 mgb_assert(iter != m_addr2size.end());
133 m_cur_usage -= iter->second;
134 m_addr2size.erase(iter);
135 }
136
137 size_t peak_usage() const { return m_peak_usage; }
138};

Callers 1

TESTFunction · 0.45

Calls 3

findMethod · 0.45
endMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected