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.
5 #include "platform_test.h"
9 // Chromium compiles this file as ARC, but other dependencies pull it in and
10 // compile it as non-ARC. Be sure that this file compiles correctly with either
15 // Note that this uses the direct runtime interface to the autorelease pool.
16 // https://clang.llvm.org/docs/AutomaticReferenceCounting.html#runtime-support
17 // This is so this can work correctly whether or not it's compiled for ARC.
20 void* objc_autoreleasePoolPush(void);
21 void objc_autoreleasePoolPop(void* pool);
24 PlatformTest::PlatformTest() : autorelease_pool_(objc_autoreleasePoolPush()) {}
26 PlatformTest::~PlatformTest() {
27 objc_autoreleasePoolPop(autorelease_pool_);