Debian Codegraph @

tools/AutoreleasePool.h

raw
1 /*
2 * Copyright 2019 Google LLC
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #ifndef SkAutoreleasePool_DEFINED
9 #define SkAutoreleasePool_DEFINED
10
11 #include "include/private/base/SkFeatures.h"
12
13 /*
14 * Helper class for managing an autorelease pool for Metal. On other platforms this will
15 * do nothing so there's no need to #ifdef it out.
16 */
17 #if defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS)
18 class AutoreleasePool {
19 public:
20 AutoreleasePool();
21 ~AutoreleasePool();
22
23 void drain();
24
25 private:
26 void* fPool;
27 };
28 #else
29 class AutoreleasePool {
30 public:
31 AutoreleasePool() {}
32 ~AutoreleasePool() = default;
33
34 void drain() {}
35 };
36 #endif
37
38 #endif