]> git.saurik.com Git - apple/libdispatch.git/blob - src/BlocksRuntime/data.c
libdispatch-703.50.37.tar.gz
[apple/libdispatch.git] / src / BlocksRuntime / data.c
1 // This source file is part of the Swift.org open source project
2 //
3 // Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
4 // Licensed under Apache License v2.0 with Runtime Library Exception
5 //
6 // See http://swift.org/LICENSE.txt for license information
7 // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
8 //
9
10 /********************
11 NSBlock support
12
13 We allocate space and export a symbol to be used as the Class for the on-stack and malloc'ed copies until ObjC arrives on the scene. These data areas are set up by Foundation to link in as real classes post facto.
14
15 We keep these in a separate file so that we can include the runtime code in test subprojects but not include the data so that compiled code that sees the data in libSystem doesn't get confused by a second copy. Somehow these don't get unified in a common block.
16 **********************/
17 #define BLOCK_EXPORT extern __attribute__((visibility("default")))
18
19 BLOCK_EXPORT void * _NSConcreteStackBlock[32] = { 0 };
20 BLOCK_EXPORT void * _NSConcreteMallocBlock[32] = { 0 };
21 BLOCK_EXPORT void * _NSConcreteAutoBlock[32] = { 0 };
22 BLOCK_EXPORT void * _NSConcreteFinalizingBlock[32] = { 0 };
23 BLOCK_EXPORT void * _NSConcreteGlobalBlock[32] = { 0 };
24 BLOCK_EXPORT void * _NSConcreteWeakBlockVariable[32] = { 0 };