1) Doesn't rely on Apple-incompatible behaviour in the GCC runtime that introduces fun heisenbugs.
2) Doesn't require constructing the dtable for NSZombie if we're not actually using it.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32039 72102866-910b-0410-8b05-ffd578937521
MIPS64 specific adjustment of atomic functions for mips.
Patch by Sebastian Reitenbach <sebastia@l00-bugdead-prods.de>.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@31841 72102866-910b-0410-8b05-ffd578937521
incorrect result or even crash when asking a class object for the
signature of one of its class methods.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@31365 72102866-910b-0410-8b05-ffd578937521
All of the sel_* stuff is now replaced with the newer APIs. As a side-effect, a blob of code that was copied-and-pasted all over GNUstep has now been moved into ObjectiveC2 and just called.
Class posing with libobjc2 will now throw an exception, rather than just aborting.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@31268 72102866-910b-0410-8b05-ffd578937521
Most of these changes involve simply removing direct manipulation of any runtime structures and replacing them with runtime function calls. For example class->name becomes class_getName(class) and so on.
libobjc2, like the Apple runtime, the NeXT runtime, and every version of the Objective-C spec, calls the class pointer in id isa. A few files now have #define class_pointer isa at the top. This line replaces class_pointer in the old GNU libobjc headers with isa so either class_pointer or isa can be used for accessing the class of an object. Note: object_getClass() should be used in most cases because, in some future version of the runtime, this will skip things like lock classes and other hidden classes (e.g. KVO classes).
All of the old forwarding stuff has been removed. Most of this stuff followed convoluted code paths that ended with an exception. A few simply broke in exciting ways. Hopefully no one has used them for the last ten years or so, but we can bring them back with some #ifndef stuff if they're really needed by anyone.
There is currently a bug in configure, which prevents dladdr() from being detected, so you need to manually tweak config.h to build - I have not fixed the fall-back code in objc-load.m to work with libobjc2, I just added a new version that uses the loader's functionality directly.
Although -base now builds, it builds with a lot of warnings. <string.h> is missing from a lot of files, so memcpy() and strlen() generate implicit function declaration warnings.
Additionally, libobjc2 does still provide the sel_{get,register}_*() functions, but they're wrappers around the newer API ones. These are deprecated and are not exposed in the headers. Although they work, we should be replacing them with the libobjc2 versions as soon as possible.
This incorporates a patch by Eric.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@31265 72102866-910b-0410-8b05-ffd578937521
- Moving the linear search over all of the method lists in the class hierarchy to the end. If we found the type info in the protocol list, we were throwing this info away. Doing something expensive and then discarding the result is generally not a good idea.
- Replacing the linear search of the method lists with a dtable lookup on libobjc2. The type info for methods is part of the slot, so we only need to do the expensive search at all on the old runtime. With libobjc2, type info lookup costs as little as IMP lookup, so doing things the slow way is not required.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@31231 72102866-910b-0410-8b05-ffd578937521
to avoid a compile error when this code is inlined more than once. In
addition, use the optimized assembler definitions also on PowerPC
machines running Darwin/Mac OS X.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@30239 72102866-910b-0410-8b05-ffd578937521
so people can safely write subclasses using different allocation schemes.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29847 72102866-910b-0410-8b05-ffd578937521
Any blocks will have their isa pointer set to the two classes statically allocated in libobjc, but these classes can't be used for message lookup (or introspection) until after the call. This means that you can't send messages to blocks until after NSObject's +load method has been called. This shouldn't be a problem in most code, but if you use __attribute__((constructor)) instead of a +load method then be careful about sending messages to blocks (you can still call them as normal).
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29144 72102866-910b-0410-8b05-ffd578937521