this repo has no description
at trunk 28 lines 896 B view raw
1// Copyright (c) Facebook, Inc. and its affiliates. (http://www.facebook.com) 2#include "cpython-func.h" 3#include "cpython-types.h" 4 5#include "api-handle.h" 6#include "runtime.h" 7 8namespace py { 9 10PY_EXPORT PyTypeObject* PyAsyncGen_Type_Ptr() { 11 Runtime* runtime = Thread::current()->runtime(); 12 return reinterpret_cast<PyTypeObject*>(ApiHandle::borrowedReference( 13 runtime, runtime->typeAt(LayoutId::kAsyncGenerator))); 14} 15 16PY_EXPORT PyTypeObject* PyCoro_Type_Ptr() { 17 Runtime* runtime = Thread::current()->runtime(); 18 return reinterpret_cast<PyTypeObject*>(ApiHandle::borrowedReference( 19 runtime, runtime->typeAt(LayoutId::kCoroutine))); 20} 21 22PY_EXPORT PyTypeObject* PyGen_Type_Ptr() { 23 Runtime* runtime = Thread::current()->runtime(); 24 return reinterpret_cast<PyTypeObject*>(ApiHandle::borrowedReference( 25 runtime, runtime->typeAt(LayoutId::kGenerator))); 26} 27 28} // namespace py