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

Method free

lite/test/test_network.cpp:40–48  ·  view source on GitHub ↗

free the memory pointed by ptr in the given device

Source from the content-addressed store, hash-verified

38
39 //! free the memory pointed by ptr in the given device
40 void free(LiteDeviceType device, int, void* ptr) override {
41 m_nr_left--;
42 LITE_ASSERT(device == LiteDeviceType::LITE_CPU);
43#ifdef WIN32
44 _aligned_free(ptr);
45#else
46 ::free(ptr);
47#endif
48 };
49 std::atomic_size_t m_nr_left{0};
50 std::atomic_size_t m_nr_allocated{0};
51};

Callers 2

alloc_staticMethod · 0.45

Calls 1

freeFunction · 0.85

Tested by

no test coverage detected