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

Method swap

src/core/impl/utils/mempool.cpp:11–17  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9MemPoolStorage& MemPoolStorage::operator=(MemPoolStorage&& rhs) noexcept = default;
10
11void MemPoolStorage::swap(MemPoolStorage& other) {
12 m_buf.swap(other.m_buf);
13 m_free.swap(other.m_free);
14 std::swap(m_disable_freelist, other.m_disable_freelist);
15 std::swap(m_cur_buf_pos, other.m_cur_buf_pos);
16 std::swap(m_cur_buf_size_bytes, other.m_cur_buf_size_bytes);
17}
18
19void* MemPoolStorage::alloc(size_t elem_size) {
20 constexpr size_t MAX_BUF_SIZE = 32 * 1024; // max 32 KiB per buf

Callers 15

reset_fileMethod · 0.45
reset_fileMethod · 0.45
set_implMethod · 0.45
as_recorded_seqMethod · 0.45
get_comp_seqMethod · 0.45
grad_manager.cppFile · 0.45
run_static_mem_allocMethod · 0.45
param_val.hFile · 0.45

Calls 1

swapFunction · 0.85

Tested by

no test coverage detected