Commit graph

426 commits

Author SHA1 Message Date
Richard Frith-MacDonald
e43c12542a Don't use windows atomics unless compiler ones aren't available
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39932 72102866-910b-0410-8b05-ffd578937521
2016-06-27 19:05:40 +00:00
Richard Frith-MacDonald
0c7237ec08 s390x portability fixes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39901 72102866-910b-0410-8b05-ffd578937521
2016-06-22 07:54:16 +00:00
Richard Frith-MacDonald
71941dd24d cleanup changes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39762 72102866-910b-0410-8b05-ffd578937521
2016-05-14 09:34:01 +00:00
Richard Frith-MacDonald
4a6d6225b9 tidied
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39738 72102866-910b-0410-8b05-ffd578937521
2016-05-10 17:03:02 +00:00
Richard Frith-MacDonald
d40d219015 removal of garbage collection
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39608 72102866-910b-0410-8b05-ffd578937521
2016-03-25 11:15:28 +00:00
Richard Frith-MacDonald
62d2bcbabc changes for use of _WIN32 define on windows
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39492 72102866-910b-0410-8b05-ffd578937521
2016-03-09 13:16:16 +00:00
Richard Frith-MacDonald
e27363d97d Don't initialise NSUserDefaults in NSObject+initialize ... recursion on bsd
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39393 72102866-910b-0410-8b05-ffd578937521
2016-02-18 06:56:44 +00:00
Richard Frith-MacDonald
91d3484e9b fix typo in comment
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39022 72102866-910b-0410-8b05-ffd578937521
2015-10-03 17:11:00 +00:00
Richard Frith-MacDonald
fa3b26e91c improve logging of sending bad selector to be performed
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39021 72102866-910b-0410-8b05-ffd578937521
2015-10-03 16:56:07 +00:00
Richard Frith-MacDonald
3b02814665 more updates
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38803 72102866-910b-0410-8b05-ffd578937521
2015-07-16 08:44:15 +00:00
Richard Frith-MacDonald
841ddf78e0 memory usage interrogation
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38799 72102866-910b-0410-8b05-ffd578937521
2015-07-15 14:14:21 +00:00
Richard Frith-MacDonald
13e4d77cec fix hash generation for 64bit processors
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38294 72102866-910b-0410-8b05-ffd578937521
2015-01-16 14:29:38 +00:00
Richard Frith-MacDonald
4101cadd82 mips fix bug #42693
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37990 72102866-910b-0410-8b05-ffd578937521
2014-07-13 07:31:33 +00:00
Quentin Mathe
354ab0f46f Fixed -respondsToSelector: and +instancesRespondToSelector: to check
+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
2014-01-18 16:04:34 +00:00
Richard Frith-MacDonald
3a895af609 Fix zombie creation for new runtime with hidden class for associated objects
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37553 72102866-910b-0410-8b05-ffd578937521
2014-01-07 11:09:05 +00:00
Richard Frith-MacDonald
e9ff4f3a3c Fix for bug #41111
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37551 72102866-910b-0410-8b05-ffd578937521
2014-01-07 10:41:49 +00:00
Richard Frith-MacDonald
9944f1823f attempt to fix #39125
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37479 72102866-910b-0410-8b05-ffd578937521
2013-12-20 10:45:52 +00:00
Richard Frith-MacDonald
ed09c55959 leak detection improvements
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37003 72102866-910b-0410-8b05-ffd578937521
2013-08-22 15:44:54 +00:00
Richard Frith-MacDonald
4551738b6f tweak guess of reasonable padding/alignment size when not provided by compiler
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@36876 72102866-910b-0410-8b05-ffd578937521
2013-07-12 06:35:32 +00:00
Richard Frith-MacDonald
51ff14a945 Alignment fixup
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@36845 72102866-910b-0410-8b05-ffd578937521
2013-07-06 07:48:26 +00:00
Richard Frith-MacDonald
d65b9254dd minor fixes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@36839 72102866-910b-0410-8b05-ffd578937521
2013-07-05 20:31:54 +00:00
Richard Frith-MacDonald
05bf612939 Suppress unwanted compiler warning by using clang-specific pragmas only when compiling with clang.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@36811 72102866-910b-0410-8b05-ffd578937521
2013-07-03 06:50:26 +00:00
Richard Frith-MacDonald
da4f7056ca printf style format tweaks
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@36799 72102866-910b-0410-8b05-ffd578937521
2013-07-02 15:46:26 +00:00
David Chisnall
8078bd8bee Fix -finalize to correctly call the C++ destructors even for hidden classes.
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
2013-05-08 10:40:23 +00:00
Richard Frith-MacDonald
5fac2e2ca2 tidyups
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@36517 72102866-910b-0410-8b05-ffd578937521
2013-04-13 10:40:15 +00:00
Niels Grewe
383d5ccec2 Changes to support clang's __attribute__((objc_root_class)).
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@35412 72102866-910b-0410-8b05-ffd578937521
2012-08-16 12:31:16 +00:00
Richard Frith-MacDonald
2ae70d0d9b improvements from Niels Grewe
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@35279 72102866-910b-0410-8b05-ffd578937521
2012-07-09 16:42:19 +00:00
Eric Wasylishen
4db79e6fef * Source/GSLocale.m:
- 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
2012-02-28 06:20:53 +00:00
Richard Frith-MacDonald
32fc733268 changes to support alternative header locations
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@34290 72102866-910b-0410-8b05-ffd578937521
2011-12-15 09:42:39 +00:00
Fred Kiefer
8da720fc7a * Source/NSObject.m (__builtin_offsetof): Add workaround for build in missing
in old versions of gcc.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33774 72102866-910b-0410-8b05-ffd578937521
2011-08-22 11:02:10 +00:00
David Chisnall
4cdea64975 Make -base compile almost without warnings again. Fixes:
- 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
2011-08-16 16:04:43 +00:00
David Chisnall
8c89a86607 In -finalize, we're pretending to be the Objective-C runtime, so we need to
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
2011-08-07 18:00:55 +00:00
David Chisnall
bb2e9d0627 When calling -.cxx_dealloc, look up the superclass before calling. This method
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
2011-08-07 16:56:58 +00:00
David Chisnall
48e1b94ef8 Change the order of the retain count and the padding, so the retain count is
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
2011-07-26 20:08:10 +00:00
David Chisnall
40456f7787 Remove the zone pointer from objects. Now we always query the zones to find the relevant pointer. Zones are still supported, but we now optimise for the case where they are not used.
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
2011-07-23 12:19:19 +00:00
Wolfgang Lux
f9f1f879f4 Override NSObject +zone to ensure that -zone returns a valid zone
pointer when it is called on a class object.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33498 72102866-910b-0410-8b05-ffd578937521
2011-07-10 14:48:26 +00:00
David Chisnall
0618607b3a Use -retainCount instead of NSExtraRefCount() in gs_weak_load() so we can support objects that define a custom retain / release mechanism in weak variables.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33478 72102866-910b-0410-8b05-ffd578937521
2011-07-07 12:29:54 +00:00
David Chisnall
35f66911a8 Fix typo NS -> GS. We don't actually want NSAllocateObject to call NSAllocateObject...
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33458 72102866-910b-0410-8b05-ffd578937521
2011-07-04 21:23:26 +00:00
David Chisnall
2a2d7339d1 Switch the order of the reference count and the zone so that the reference count (in reference counted mode) is always immediately in front of the object. Please test this!!
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
2011-07-04 11:31:28 +00:00
David Chisnall
38566d1888 Don't call c++ constructors when allocating a class with class_createInstance() - this function calls them itself, and calling them twice is a bad idea.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33436 72102866-910b-0410-8b05-ffd578937521
2011-07-03 11:04:04 +00:00
David Chisnall
46b12a71e8 Add support to NSObject for automatically zeroing __weak references when using ARC.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33408 72102866-910b-0410-8b05-ffd578937521
2011-06-29 13:13:15 +00:00
Richard Frith-MacDonald
e84d049078 Add some flexibility
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33355 72102866-910b-0410-8b05-ffd578937521
2011-06-20 07:33:27 +00:00
Richard Frith-MacDonald
c5c5f18075 fix a couple of leak detection bugs
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33353 72102866-910b-0410-8b05-ffd578937521
2011-06-20 04:37:20 +00:00
Richard Frith-MacDonald
523366101e more leak cleanup stuff
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33349 72102866-910b-0410-8b05-ffd578937521
2011-06-19 13:34:17 +00:00
Richard Frith-MacDonald
9831216043 Start stuff for handling cleanup on process exit.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33344 72102866-910b-0410-8b05-ffd578937521
2011-06-19 09:26:03 +00:00
Richard Frith-MacDonald
6707dd35ad Patches by Sebastian Reitenbach
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33338 72102866-910b-0410-8b05-ffd578937521
2011-06-18 12:57:30 +00:00
Eric Wasylishen
f2a470d893 tweak and re-enable atomic ops detection
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33179 72102866-910b-0410-8b05-ffd578937521
2011-05-28 18:05:14 +00:00
David Chisnall
6a4d9fd5ae Fix a few functions that I missed for hybrid mode.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33178 72102866-910b-0410-8b05-ffd578937521
2011-05-28 15:28:24 +00:00
David Chisnall
4db587f9d6 First pass at hybrid GC mode. This will try use retain-release mode if the collector is not running. Code will run in retain/release mode unless something compiled with -fobjc-gc-only is loaded.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33174 72102866-910b-0410-8b05-ffd578937521
2011-05-28 14:51:40 +00:00
Niels Grewe
2c301fb937 Disable atomic ops detection for the time being.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33163 72102866-910b-0410-8b05-ffd578937521
2011-05-28 10:00:22 +00:00
Richard Frith-MacDonald
29063b6928 minor tweaks for atomic inc/dec support
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33142 72102866-910b-0410-8b05-ffd578937521
2011-05-27 10:05:25 +00:00
Niels Grewe
410ab087fa Attempt to detect the flags needed to enable compiler intrinsics for atomic
operations.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33134 72102866-910b-0410-8b05-ffd578937521
2011-05-26 18:37:58 +00:00
Richard Frith-MacDonald
8da9a5ecbb Another attempt to improve atomic inc/dec
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33119 72102866-910b-0410-8b05-ffd578937521
2011-05-25 22:18:39 +00:00
Richard Frith-MacDonald
ac2b43669d Tweak atomic inc/dec code
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33116 72102866-910b-0410-8b05-ffd578937521
2011-05-25 16:47:11 +00:00
Richard Frith-MacDonald
eb39994378 partial revert
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33115 72102866-910b-0410-8b05-ffd578937521
2011-05-25 15:53:17 +00:00
David Chisnall
b08b2d0f34 More tweaks for garbage collection mode, including making NSNotificationCenter use weak pointers (things are never removed if it uses strong pointers because they remove themselves in the -dealloc method, which is never called, and can't remove themselves in the -finalize method because the -finalize method would not be called until after they have been removed - this is consistent with Apple behaviour).
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
2011-05-25 11:15:08 +00:00
Richard Frith-MacDonald
a439972605 attempt multithreading bugfix
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33107 72102866-910b-0410-8b05-ffd578937521
2011-05-25 09:20:42 +00:00
David Chisnall
6068e9484c Initial pass at implementing fully Apple-compatible GC. This requires the code to be built with -fobjc-gc or -fobjc-gc-only, and requires a runtime that implements all of the support functions (GNUstep runtime trunk or 1.5 when it's release).
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
2011-05-24 14:43:27 +00:00
Richard Frith-MacDonald
88cd94d250 gc fixup
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32860 72102866-910b-0410-8b05-ffd578937521
2011-04-14 12:31:51 +00:00
Richard Frith-MacDonald
4d646deb2e try to get C++ constructur/destructor calling working for all.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32781 72102866-910b-0410-8b05-ffd578937521
2011-04-05 12:13:12 +00:00
Richard Frith-MacDonald
899590c40c tweaks for OpenBSD
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32766 72102866-910b-0410-8b05-ffd578937521
2011-04-03 09:54:57 +00:00
Richard Frith-MacDonald
7eaee133a3 GC fix for proxy finalisation error.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32764 72102866-910b-0410-8b05-ffd578937521
2011-04-03 04:25:52 +00:00
Wolfgang Lux
2a50497248 Get -methodSignatureForSelector: right again in case the method is
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
2011-03-22 20:59:06 +00:00
David Chisnall
4ca1911f13 Correctly call C++ constructors / destructors for C++ 'objects' in ObjC++ ivars.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32632 72102866-910b-0410-8b05-ffd578937521
2011-03-17 15:02:52 +00:00
Richard Frith-MacDonald
84b2f8d5bf mingw fixups
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32541 72102866-910b-0410-8b05-ffd578937521
2011-03-13 09:41:20 +00:00
Richard Frith-MacDonald
ee7872e6fd mingw block fixups
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32540 72102866-910b-0410-8b05-ffd578937521
2011-03-13 09:38:37 +00:00
Richard Frith-MacDonald
4b367a26d2 tweak
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32516 72102866-910b-0410-8b05-ffd578937521
2011-03-09 12:01:04 +00:00
Richard Frith-MacDonald
218582e63c more bsd tweaks
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32485 72102866-910b-0410-8b05-ffd578937521
2011-03-07 15:34:06 +00:00
Richard Frith-MacDonald
542fb72c06 minor KVO fix
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32432 72102866-910b-0410-8b05-ffd578937521
2011-03-02 10:52:27 +00:00
Richard Frith-MacDonald
05e186ac65 fix gc heade rlocation.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32388 72102866-910b-0410-8b05-ffd578937521
2011-02-27 17:53:14 +00:00
Richard Frith-MacDonald
5fbd5d08a7 fix typo
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32387 72102866-910b-0410-8b05-ffd578937521
2011-02-27 16:14:26 +00:00
Richard Frith-MacDonald
59d4be1265 OSX compat tweaks
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32323 72102866-910b-0410-8b05-ffd578937521
2011-02-23 11:52:17 +00:00
Richard Frith-MacDonald
61bc059d4a Cleanup ... avoid accessing the 'isa' variable directly.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32247 72102866-910b-0410-8b05-ffd578937521
2011-02-20 16:21:43 +00:00
Richard Frith-MacDonald
4ed081d410 Replace old code directly referencing class_pointer ivar with calls to the new runtime API treating objects as opaque pointers.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32243 72102866-910b-0410-8b05-ffd578937521
2011-02-20 12:28:12 +00:00
Richard Frith-MacDonald
0cb48d516b Update for new runtime api
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32241 72102866-910b-0410-8b05-ffd578937521
2011-02-20 08:32:54 +00:00
Richard Frith-MacDonald
56fe3ad777 Try to make code more robust and comment copiously.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32107 72102866-910b-0410-8b05-ffd578937521
2011-02-12 16:33:40 +00:00
Richard Frith-MacDonald
f7e7ef50c3 Don't call [NSZombie+class] as the method doesn't exist.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32105 72102866-910b-0410-8b05-ffd578937521
2011-02-12 15:44:00 +00:00
Richard Frith-MacDonald
11e6f51bf4 remove unused code
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32089 72102866-910b-0410-8b05-ffd578937521
2011-02-12 06:12:39 +00:00
Richard Frith-MacDonald
594a654252 NSZombie fixups
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32051 72102866-910b-0410-8b05-ffd578937521
2011-02-11 10:00:00 +00:00
David Chisnall
0239c9b9a5 Use NSClassFromString() to look up NSZombie class. This has two advantages:
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
2011-02-10 18:53:48 +00:00
David Chisnall
0d28d838fd Revert last commit. The actual Apple behaviour is what libobjc2 used to do, not what it does now. It's incredibly ugly, and should not have been allowed: It makes NSObject the superclass of NSObject's metaclass, but does NOT do the same transform for any other classes.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32038 72102866-910b-0410-8b05-ffd578937521
2011-02-10 18:40:18 +00:00
David Chisnall
a8cd2e588c Make [NSObject -class] return self if self is a class. This is needed for a weird bit of the ObjC spec relating to metaclasses of root classes. The GNUstep runtime behaviour mimics the Apple behaviour, while the GCC runtime mimics the StepStone behaviour, so we get some somewhat irritating differences.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32037 72102866-910b-0410-8b05-ffd578937521
2011-02-10 18:33:26 +00:00
Richard Frith-MacDonald
bc34d0505f Minor cleanups.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32031 72102866-910b-0410-8b05-ffd578937521
2011-02-10 10:52:54 +00:00
Richard Frith-MacDonald
e1dbeb420e minor OSX compatibility tweak
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@31847 72102866-910b-0410-8b05-ffd578937521
2011-01-07 09:52:20 +00:00
Fred Kiefer
a4a57e144f * Source/NSObject.m (GSAtomicIncrement, GSAtomicDecrement):
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
2011-01-06 12:48:29 +00:00
Nicola Pero
0a0a147ae9 Updated for GCC 4.6
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@31771 72102866-910b-0410-8b05-ffd578937521
2010-12-24 17:19:40 +00:00
Nicola Pero
ba3fac5d5b Fixed [NSObject +conformsToProtocol:] and [NSObject -conformsToProtocol:]
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@31769 72102866-910b-0410-8b05-ffd578937521
2010-12-24 15:37:06 +00:00
Nicola Pero
30f098f9f8 Updated code to compile with GCC 4.6 and the new GNU Objective-C runtime
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@31765 72102866-910b-0410-8b05-ffd578937521
2010-12-23 02:23:05 +00:00
David Chisnall
e9b0540890 Fix -methodSignatureForSelector: fast path with libobjc2.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@31371 72102866-910b-0410-8b05-ffd578937521
2010-09-18 15:09:58 +00:00
Wolfgang Lux
fb76b96247 Fix bug were NSObject -methodSignatureForSelector: would return an
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
2010-09-17 20:07:50 +00:00
Eric Wasylishen
d7a7393a0b Minor build fixes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@31271 72102866-910b-0410-8b05-ffd578937521
2010-09-09 17:02:19 +00:00
David Chisnall
4488708e84 Fix a load of warnings from implicit function declarations. A lot were caused by ctype.h and string.h stuff being used everywhere in GNUstep but not included anywhere - they're now included in common.h (at least string.h should also be in Foundation.h - on OS X it is implicitly included via some chain of things from Foundation.h).
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
2010-09-09 16:30:10 +00:00
David Chisnall
7a80adeb9b A huge blob of changes to make -base build with libobjc2, without using the old libobjc2 headers.
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
2010-09-09 15:06:09 +00:00
Richard Frith-MacDonald
3564932935 remove obsolete typed stream inclusion
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@31248 72102866-910b-0410-8b05-ffd578937521
2010-09-08 09:00:15 +00:00
David Chisnall
e58ea125de Improve the efficiency of NSObject's methodSignatureForSelector by:
- 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
2010-09-02 15:17:46 +00:00
Richard Frith-MacDonald
821a21b54d better cope with null selectors.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@31178 72102866-910b-0410-8b05-ffd578937521
2010-08-17 18:36:46 +00:00
Richard Frith-MacDonald
3a856711c1 Remove backward compatibility code
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@30866 72102866-910b-0410-8b05-ffd578937521
2010-06-26 14:23:07 +00:00
Richard Frith-MacDonald
b417e6bf8c Workaround for runitme bug.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@30864 72102866-910b-0410-8b05-ffd578937521
2010-06-26 14:04:09 +00:00
David Chisnall
0409dd3080 Some cleanup of NSObject. Call runtime functions, rather than duplicate their implementation, and only conditionally call some non-portable functions.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@30597 72102866-910b-0410-8b05-ffd578937521
2010-06-07 02:50:40 +00:00
Richard Frith-MacDonald
2edc03af19 OpenBSD fix
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@30489 72102866-910b-0410-8b05-ffd578937521
2010-05-30 16:06:04 +00:00