* use fiber local storage if NO_PTHREADS is defined
* use critical sections instead of mutexes
Contributing-author: Ben Viglietta <benvi@microsoft.com>
macOS ships with libc++abi, which doesn't provide the hooks required
for interop, so this was causing all of the tests to fail to link in
the Travis macOS test. We're now correctly detecting that it won't
work on macOS and disabling those tests.
Throwing an Objective-C exception through a C++ catch block was broken.
This was because the C++ code inserts a cleanup handler to make sure
that it invokes `__cxa_end_catch`. Unwinding through this catchup
transformed the Objective-C exception into a C++ one. This case should
have been handled, except for two bugs:
1. A typo (`#ifdef` instead of `#ifndef`) meant that we were not
extracting the Objective-C exception from the C++ object.
2. We were skipping everything except catchalls after the search phase,
because we lose some information in the transformation.
Fixes#49
Weak refs were being left as dangling pointers after being deleted. The
load that caused the deallocation would return nil, but then the next
one would dereference a dangling pointer.
Fixes a bug introduced (replacing a similar bug) in the last rewrite of
objc_moveWeak. This version should now be correct.
objc_copyWeak was implemented in a naive way, which had a lot more
overhead than required.
Rather than tracking all of the locations of weak pointers, keep a weak
refcount. This should also make it easier to add finer-grained locking to weak
references.
Some applications still include the old objc-class.h header expecting
to obtain the declarations contained in objc/message.h and
objc/runtime.h nowadays. This commit adds this header to achieve
out-of-the-box compatibility with these applications.
On FreeBSD and OSX, the block runtime functions are defined on a Block.h
and a Block_private.h headers on the include path as opposed to
libobjc2's objc/blocks_runtime.h and objc/blocks_private.h respectively.
This commit amends libobjc2's install routine to create the
FreeBSD-style headers as symlinks to the ones provided by libobjc2 for
improved compatibility.
Some applications still include the old objc-runtime.h header expecting
to obtain the declarations contained in objc/message.h and
objc/runtime.h nowadays. This commit adds this header to achieve
out-of-the-box compatibility with these applications.
correct.
Instance variables are not normally zero-sized, but some are. Examples
include zero-length arrays at the end of a class, and bitfields.
Fixes#30Fixes#31