1// Copyright 2006-2008 The Chromium Authors 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5#include "platform_test.h" 6 7// Note that this uses the direct runtime interface to the autorelease pool. 8// https://clang.llvm.org/docs/AutomaticReferenceCounting.html#runtime-support 9// This is so this can work when compiled for ARC. 10 11extern "C" { 12void* objc_autoreleasePoolPush(void); 13void objc_autoreleasePoolPop(void* pool); 14} 15 16PlatformTest::PlatformTest() : autorelease_pool_(objc_autoreleasePoolPush()) {} 17 18PlatformTest::~PlatformTest() { 19 objc_autoreleasePoolPop(autorelease_pool_); 20} 21