Brad Bishop | ab795a1 | 2017-01-05 20:50:49 -0500 | [diff] [blame] | 1 | #pragma once |
2 | |||||
3 | #include <cstdlib> | ||||
4 | |||||
5 | namespace phosphor | ||||
6 | { | ||||
7 | namespace utility | ||||
8 | { | ||||
9 | /** @struct Free | ||||
10 | * @brief A malloc cleanup type for use with smart pointers. | ||||
11 | */ | ||||
12 | template <typename T> | ||||
13 | struct Free | ||||
14 | { | ||||
15 | void operator()(T* ptr) const | ||||
16 | { | ||||
17 | free(ptr); | ||||
18 | } | ||||
19 | }; | ||||
20 | } // namespace utility | ||||
21 | } // namespace phosphor | ||||
22 | // vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 |