yum-mirror/VkFFT
git clone https://git.yummers.dev/yum-mirror/VkFFT
ba7001c
v1.2.31
1//------------------------------------------------------------------------------------------------------------------------------------------------------------- 2// 3// Foundation/NSAutoreleasePool.hpp 4// 5// Copyright 2020-2021 Apple Inc. 6// 7// Licensed under the Apache License, Version 2.0 (the "License"); 8// you may not use this file except in compliance with the License. 9// You may obtain a copy of the License at 10// 11// http://www.apache.org/licenses/LICENSE-2.0 12// 13// Unless required by applicable law or agreed to in writing, software 14// distributed under the License is distributed on an "AS IS" BASIS, 15// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16// See the License for the specific language governing permissions and 17// limitations under the License. 18// 19//------------------------------------------------------------------------------------------------------------------------------------------------------------- 20 21#pragma once 22 23//------------------------------------------------------------------------------------------------------------------------------------------------------------- 24 25#include "NSDefines.hpp" 26#include "NSObject.hpp" 27#include "NSPrivate.hpp" 28#include "NSTypes.hpp" 29 30//------------------------------------------------------------------------------------------------------------------------------------------------------------- 31 32namespace NS 33{ 34class AutoreleasePool : public Object 35{ 36public : 37static AutoreleasePool * alloc () ; 38AutoreleasePool * init () ; 39 40void drain () ; 41 42void addObject ( Object * pObject ) ; 43 44static void showPools () ; 45} ; 46} 47 48//------------------------------------------------------------------------------------------------------------------------------------------------------------- 49 50_NS_INLINE NS :: AutoreleasePool * NS :: AutoreleasePool :: alloc () 51{ 52return NS :: Object :: alloc < AutoreleasePool > ( _NS_PRIVATE_CLS ( NSAutoreleasePool )) ; 53} 54 55//------------------------------------------------------------------------------------------------------------------------------------------------------------- 56 57_NS_INLINE NS :: AutoreleasePool * NS :: AutoreleasePool :: init () 58{ 59return NS :: Object :: init < AutoreleasePool > () ; 60} 61 62//------------------------------------------------------------------------------------------------------------------------------------------------------------- 63 64_NS_INLINE void NS :: AutoreleasePool :: drain () 65{ 66Object :: sendMessage < void > ( this , _NS_PRIVATE_SEL ( drain )) ; 67} 68 69//------------------------------------------------------------------------------------------------------------------------------------------------------------- 70 71_NS_INLINE void NS :: AutoreleasePool :: addObject ( Object * pObject ) 72{ 73Object :: sendMessage < void > ( this , _NS_PRIVATE_SEL ( addObject_ ) , pObject ) ; 74} 75 76//------------------------------------------------------------------------------------------------------------------------------------------------------------- 77 78_NS_INLINE void NS :: AutoreleasePool :: showPools () 79{ 80Object :: sendMessage < void > ( _NS_PRIVATE_CLS ( NSAutoreleasePool ) , _NS_PRIVATE_SEL ( showPools )) ; 81} 82 83//-------------------------------------------------------------------------------------------------------------------------------------------------------------