1 // Copyright 2018 The Fuchsia Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #pragma once
6 
7 #include <fbl/alloc_checker.h>
8 #include <memory>
9 
10 namespace ktl {
11 
12 template <typename T, typename Deleter = ::std::default_delete<T>>
13 using unique_ptr = std::unique_ptr<T, Deleter>;
14 
15 template <typename T, typename... Args>
make_unique(fbl::AllocChecker * ac,Args &&...args)16 unique_ptr<T> make_unique(fbl::AllocChecker* ac, Args&&... args) {
17     return unique_ptr<T>(new (ac) T(std::forward<Args>(args)...));
18 }
19 
20 } // namespace ktl
21