Commit graph

367 commits

Author SHA1 Message Date
rfm
21636b06d9 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
rfm
3efbfa42e2 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
rfm
e158dc8d68 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
rfm
e5c0b1887d 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
qmathe
113456db5c 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
rfm
84425c4a30 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
rfm
54c7ddf7ee 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
rfm
19bee40b91 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
rfm
1483924463 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
rfm
791b709752 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
rfm
5ee4405ad4 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
rfm
5f8d366814 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
rfm
2d2d0be74f 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
rfm
bddd1e734f 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
theraven
2a206b02c2 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
rfm
d134057c06 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
thebeing
d10498bd01 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
rfm
f03b67a59c 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
ericwa
e8bc5d9a5f * 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
rfm
ee3f0b14a0 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
fredkiefer
dff5311a0b * 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
theraven
5568644a5e 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
theraven
68f58ffe56 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
theraven
8d699f6ff8 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
theraven
1d7274697b 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
theraven
863fff32b7 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
wlux
3d7865c21b 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
theraven
d5d099e7a6 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
theraven
af93046588 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
theraven
4d48d0bcaa 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
theraven
a064345ddd 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
theraven
57aca2c837 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
rfm
33843644e1 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
rfm
53b5f5405c 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
rfm
e78ceb4c96 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
rfm
8b2ffba3d9 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
rfm
05f8f8f257 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
ericwa
3aa5c524e6 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
theraven
ac4b932048 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
theraven
ed2ccb68d9 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
thebeing
07fa091275 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
rfm
3dd46a1d8c 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
thebeing
b6cee11863 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
rfm
957ee2b8ef 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
rfm
e4e38170f9 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
rfm
794bd55f57 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
theraven
485d23c7c7 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
rfm
cf144e76f1 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
theraven
9c75389ee7 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
rfm
3ed3b692e3 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