You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
David Chisnall 377a81d237 Add support for fast-path alloc / init methods and direct methods.
The fast paths follow the pattern that we established for fast ARC:
Framework base classes can opt in by implementing a `+_TrivialAllocInit`
method.

This opt-in behaviour is inherited and is removed implicitly in any
subclass that implements alloc or init methods (alloc and init are
treated independently).

Compilers can emit calls to `objc_alloc(cls)` instead of `[cls alloc]`,
`objc_allocWithZone(cls)` instead of `[cls allocWithZone: NULL]`, and
`objc_alloc_init` instead of `[[cls alloc] init]`.

Direct methods don't require very much support in the runtime.  Apple
reuses their fast path for `-self` (which is supported only in the Apple
fork of clang, not the upstream version) for a fast init.  Given that
the first few fields of the runtime's class structure have been stable
for around 30 years, I'm happy moving the flags word (and the
initialised bit, in particular) into the public ABI.  This lets us do a
fast-path check for whether a class is initialised in class methods and
call `objc_send_initialize` if it isn't.  This function is now exposed
as part of the public ABI, it was there already and does the relevant
checks without invoking any of the message-sending machinery.

Fixes #165 #169
2 years ago
..
Availability.h Initial pass at Windows support. 8 years ago
Object.h Mark all libobjc2 headers as system headers when not compiling the runtime 13 years ago
Protocol.h Mark all libobjc2 headers as system headers when not compiling the runtime 13 years ago
blocks_private.h Mark all libobjc2 headers as system headers when not compiling the runtime 13 years ago
blocks_runtime.h cleanup in blocks runtime for closer consistency with apple 7 years ago
capabilities.h Rename PUBLIC to OBJC_PUBLIC to avoid some namespace pollution. 7 years ago
developer.h Mark all libobjc2 headers as system headers when not compiling the runtime 13 years ago
encoding.h Export encoding functions. 5 years ago
hooks.h Support compiling on mingw (no exception handling) 2 years ago
message.h Skip tests using objc_msgSend if not available (#263) 2 years ago
objc-api.h Mark all libobjc2 headers as system headers when not compiling the runtime 13 years ago
objc-arc.h Rename PUBLIC to OBJC_PUBLIC to avoid some namespace pollution. 7 years ago
objc-auto.h Mark all libobjc2 headers as system headers when not compiling the runtime 13 years ago
objc-class.h Add objc-class.h to objc headers 9 years ago
objc-exception.h Add objc_setUncaughtExceptionHandler() API 2 years ago
objc-runtime.h Add objc-runtime.h to objc headers 9 years ago
objc-visibility.h Rename PUBLIC to OBJC_PUBLIC to avoid some namespace pollution. 7 years ago
objc.h libobjc2: add dummy objc.h and objc-api.h headers which simply include runtime.h 16 years ago
runtime-deprecated.h Mark legacy API with OBJC_PUBLIC 2 years ago
runtime.h Add support for fast-path alloc / init methods and direct methods. 2 years ago
slot.h Add a missing `extern "C"` to slot.h. 7 years ago
toydispatch.h More build system tidies. 15 years ago