+resolveInstanceMethod: and +resolveClassMethod: as documented in Cocoa
NSObject API.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37614 72102866-910b-0410-8b05-ffd578937521
Since we're emulating the runtime here rather than calling it, we need to
ensure that we emulate it correctly.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@36601 72102866-910b-0410-8b05-ffd578937521
- Deprecate GSSetLocale and GSSetLocaleC; they now do nothing
but print a warning.
- Introduce GSDefaultLanguageLocale(), which is a
substitute for GSSetLocale(LC_MESSAGES, nil), which just returns the
current setting of LC_MESSAGES.
* Source/NSObject.m (+initialize): Remove GSSetLocaleC call,
which was changing the libc locale.
* Source/NSUserDefaults.m: Use GSDefaultLanguageLocale() instead of
GSSetLocale(LC_MESSAGES, nil)
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@34841 72102866-910b-0410-8b05-ffd578937521
- Using the correct format specifier
- Remove substringFromRange: (GNUstep extension) from NSString.h and use the non-deprecated version in -base.
- Delete definitions of methods that are the same in both a class and a category on that class (NSArray and NSObject).
Two files still have warnings:
- The GNUTLS stuff is using a load of deprecated APIs.
- xmlparse.m replaces a method using a category. This method seems to always return nil. Not sure what it's meant to do, or why it isn't a delegate of some kind.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33756 72102866-910b-0410-8b05-ffd578937521
actually use isa directly, rather than the safe version. A better solution
would be to call object_dispose(), but this only works for objects created with
class_createInstance().
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33704 72102866-910b-0410-8b05-ffd578937521
may destroy the receiver's class, if it's a user-generated one, so we can't
guarantee that it is valid after the call.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33701 72102866-910b-0410-8b05-ffd578937521
always the word before isa.
Switch to using the correct kind of alignof (the ABI alignment in structures,
not the preferred alignment of the type - this stops us from allocating 4 bytes
of padding on x86-32 where there is no need for any)
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33642 72102866-910b-0410-8b05-ffd578937521
To disable zone support completely, NSAllocateObject() should ignore the zone and NSDeallocateObject() should skip the zone lookup.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33610 72102866-910b-0410-8b05-ffd578937521
Opt NSObject into the fast path for ARC. ARC will now not call the retain / release / autorelease methods on NSObject or any classes that inherit their implementation of these methods from NSObject. In quick and dirty testing, this gives about a 10-20% speedup.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33446 72102866-910b-0410-8b05-ffd578937521
Gorm now works correctly when built with GC enabled.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33109 72102866-910b-0410-8b05-ffd578937521
Currently, there are a few places where we should be calling NSAllocateCollectable() without NSScannedOption, but are actually calling NSZoneMalloc() unless we're in GC mode. We should not need separate code paths for this anywhere outside NSZone, since NSAllocateCollectable() will work in non-GC mode as well.
A few of the changes should be tweaked slightly so that they do run-time tests. For example, when compiling with -fobjc-gc, we may be linked against non-GC code, which will use -retain and -release but won't use the memory barriers. Supporting this nicely is a lot of effort, and I'm not fully convinced it's a good idea.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33104 72102866-910b-0410-8b05-ffd578937521
called on a class object and the old runtime is used.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32689 72102866-910b-0410-8b05-ffd578937521
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