[go: nahoru, domu]

blob: 738ff4110998e09438bd91b95326f4b06b5c3aee [file] [log] [blame]
Avi Drissmandfd880852022-09-15 20:11:091// Copyright 2006-2008 The Chromium Authors
mmentovai@google.com49df6022008-08-27 19:03:432// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
erikkay@google.comed2f2332008-08-20 15:59:494
jeremy@chromium.org23887f042008-12-02 19:20:155#include "platform_test.h"
erikkay@google.comed2f2332008-08-20 15:59:496
Avi Drissman35fc96c82023-07-27 17:13:397// /!\ WARNING!
8//
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
11// build setting.
12//
13// /!\ WARNING!
Avi Drissman3a2c3902023-06-08 23:45:3114
Avi Drissman491617c2023-04-13 17:33:1515// Note that this uses the direct runtime interface to the autorelease pool.
16// https://clang.llvm.org/docs/AutomaticReferenceCounting.html#runtime-support
Avi Drissman35fc96c82023-07-27 17:13:3917// This is so this can work correctly whether or not it's compiled for ARC.
erikkay@google.comed2f2332008-08-20 15:59:4918
Avi Drissman491617c2023-04-13 17:33:1519extern "C" {
20void* objc_autoreleasePoolPush(void);
21void objc_autoreleasePoolPop(void* pool);
erikkay@google.comed2f2332008-08-20 15:59:4922}
23
Avi Drissman491617c2023-04-13 17:33:1524PlatformTest::PlatformTest() : autorelease_pool_(objc_autoreleasePoolPush()) {}
25
mark@chromium.orgc77043fc2009-08-20 22:37:5926PlatformTest::~PlatformTest() {
Avi Drissman491617c2023-04-13 17:33:1527 objc_autoreleasePoolPop(autorelease_pool_);
erikkay@google.comed2f2332008-08-20 15:59:4928}