Merge pull request #10 from gunyarakun/fix-invalid-return
[cocotron.git] / objc / objc_tls.h
blob43eff1b7f69cb88c9bfb2cb5ea1bd624d6988c98
1 #import <objc/runtime.h>
2 #include <setjmp.h>
4 typedef struct objc_autoreleasepool {
5 struct objc_autoreleasepool *_parent;
6 unsigned long _pageCount;
7 id **_pages;
8 unsigned long _nextSlot;
9 struct objc_autoreleasepool *_childPool;
10 } objc_autoreleasepool;
12 typedef struct objc_exception_frame {
13 jmp_buf state;
14 struct objc_exception_frame *parent;
15 id exception;
16 } objc_exception_frame;
18 typedef void NSUncaughtExceptionHandler(id exception);
20 typedef struct objc_tls {
21 objc_autoreleasepool *pool;
22 objc_exception_frame *exception_frame;
23 NSUncaughtExceptionHandler *uncaught_exception_handler;
24 } objc_tls;
26 objc_tls *objc_tlsCurrent();