]> git.saurik.com Git - apple/xnu.git/blame_incremental - tests/intrusive_shared_ptr_src/abi.callee.smart.cpp
xnu-7195.50.7.100.1.tar.gz
[apple/xnu.git] / tests / intrusive_shared_ptr_src / abi.callee.smart.cpp
... / ...
CommitLineData
1//
2// Declare a function as returning a raw pointer (in the header), but
3// implement it by returning a shared pointer. This represents a TU that
4// would have been translated to shared pointers.
5//
6// In this TU, SharedPtr<T> is intrusive_shared_ptr<T>, since USE_SHARED_PTR
7// is defined.
8//
9
10#define USE_SHARED_PTR
11
12#include "abi_helper.h"
13
14SharedPtr<T>
15return_shared_as_raw(T* ptr)
16{
17 return SharedPtr<T>(ptr, libkern::no_retain);
18}