xref: /aosp_15_r20/external/compiler-rt/lib/BlocksRuntime/data.c (revision 7c3d14c8b49c529e04be81a3ce6f5cc23712e4c6)
1*7c3d14c8STreehugger Robot /*
2*7c3d14c8STreehugger Robot  * data.c
3*7c3d14c8STreehugger Robot  *
4*7c3d14c8STreehugger Robot  * Copyright 2008-2010 Apple, Inc. Permission is hereby granted, free of charge,
5*7c3d14c8STreehugger Robot  * to any person obtaining a copy of this software and associated documentation
6*7c3d14c8STreehugger Robot  * files (the "Software"), to deal in the Software without restriction,
7*7c3d14c8STreehugger Robot  * including without limitation the rights to use, copy, modify, merge, publish,
8*7c3d14c8STreehugger Robot  * distribute, sublicense, and/or sell copies of the Software, and to permit
9*7c3d14c8STreehugger Robot  * persons to whom the Software is furnished to do so, subject to the following
10*7c3d14c8STreehugger Robot  * conditions:
11*7c3d14c8STreehugger Robot  *
12*7c3d14c8STreehugger Robot  * The above copyright notice and this permission notice shall be included in
13*7c3d14c8STreehugger Robot  * all copies or substantial portions of the Software.
14*7c3d14c8STreehugger Robot  *
15*7c3d14c8STreehugger Robot  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16*7c3d14c8STreehugger Robot  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17*7c3d14c8STreehugger Robot  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18*7c3d14c8STreehugger Robot  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19*7c3d14c8STreehugger Robot  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20*7c3d14c8STreehugger Robot  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21*7c3d14c8STreehugger Robot  * SOFTWARE.
22*7c3d14c8STreehugger Robot  *
23*7c3d14c8STreehugger Robot  */
24*7c3d14c8STreehugger Robot 
25*7c3d14c8STreehugger Robot /********************
26*7c3d14c8STreehugger Robot NSBlock support
27*7c3d14c8STreehugger Robot 
28*7c3d14c8STreehugger Robot 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.
29*7c3d14c8STreehugger Robot 
30*7c3d14c8STreehugger Robot 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.
31*7c3d14c8STreehugger Robot **********************/
32*7c3d14c8STreehugger Robot 
33*7c3d14c8STreehugger Robot void * _NSConcreteStackBlock[32] = { 0 };
34*7c3d14c8STreehugger Robot void * _NSConcreteMallocBlock[32] = { 0 };
35*7c3d14c8STreehugger Robot void * _NSConcreteAutoBlock[32] = { 0 };
36*7c3d14c8STreehugger Robot void * _NSConcreteFinalizingBlock[32] = { 0 };
37*7c3d14c8STreehugger Robot void * _NSConcreteGlobalBlock[32] = { 0 };
38*7c3d14c8STreehugger Robot void * _NSConcreteWeakBlockVariable[32] = { 0 };
39*7c3d14c8STreehugger Robot 
_Block_copy_error(void)40*7c3d14c8STreehugger Robot void _Block_copy_error(void) {
41*7c3d14c8STreehugger Robot }
42