blob: 39749acc0ce54f9d4ff8793bf0f9fd97427f7484 [file] [log] [blame]
Brad Bishopab795a12017-01-05 20:50:49 -05001#pragma once
2
3#include <cstdlib>
4
5namespace phosphor
6{
7namespace utility
8{
9/** @struct Free
10 * @brief A malloc cleanup type for use with smart pointers.
11 */
12template <typename T>
13struct 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