Commit graph

8960 commits

Author SHA1 Message Date
David Chisnall
f7cc7203d9 Make the mkchlog.sh script update the changelog, so you don't get conflicts when you try to commit.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33167 72102866-910b-0410-8b05-ffd578937521
2011-05-28 12:51:57 +00:00
David Chisnall
55a3a9e805 Added ChangeLog entry from last commit
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33166 72102866-910b-0410-8b05-ffd578937521
2011-05-28 12:51:06 +00:00
David Chisnall
50e06b7cca __weak is only allowed on ivars and globals, so we need to turn the Observation structure into a class.
Richard:

I've run the test suite with GC disabled on Linux/x86-64 and nothing broke, but can you please review these changes carefully anyway?

We seem to be using a complex custom allocator for a structure that is not allocated or deallocated.  In typical programs, it looks like we're actually just wasting memory by using the memory pool here.  Looking at the commit log, this hasn't really been touched for about 10 years, so possibly the assumptions are no longer valid.  I can only see this being useful if someone is adding and removing hundreds of notification observers every run loop iteration.  Do you have code that does this?  If not, then can I remove the custom allocator?



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33165 72102866-910b-0410-8b05-ffd578937521
2011-05-28 12:49:52 +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
David Chisnall
668081efb2 Use correct test macro for __weak.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33162 72102866-910b-0410-8b05-ffd578937521
2011-05-27 23:36:28 +00:00
David Chisnall
68f1581eb9 This one isn't really important, since this code path is only ever used in non-GC mode, but it keeps the static analyser happy.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33145 72102866-910b-0410-8b05-ffd578937521
2011-05-27 12:00:57 +00:00
David Chisnall
6787444673 Added ChangeLog entry from last commit
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33144 72102866-910b-0410-8b05-ffd578937521
2011-05-27 11:50:26 +00:00
David Chisnall
7764740bdc Make -drain and -release in NSAutoreleasePool do the same thing (rather than one calling the other) in non-GC mode.
Replace all -release messages sent to autorelease pools with -drain.  In non-GC mode, these are equivalent.  In GC mode, these trigger a collection.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33143 72102866-910b-0410-8b05-ffd578937521
2011-05-27 11:48:44 +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
David Chisnall
417418ef8e Revert accidentally committed changes.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33140 72102866-910b-0410-8b05-ffd578937521
2011-05-27 09:18:57 +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
David Chisnall
61c20dcf92 Added ChangeLog entry from last commit
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33132 72102866-910b-0410-8b05-ffd578937521
2011-05-26 18:30:19 +00:00
David Chisnall
928551c80a Use RTLD_NOLOAD, if it's supported.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33131 72102866-910b-0410-8b05-ffd578937521
2011-05-26 18:29:43 +00:00
David Chisnall
f6496702aa Added ChanngeLog for last commit
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33124 72102866-910b-0410-8b05-ffd578937521
2011-05-26 13:25:48 +00:00
David Chisnall
de2fd8df6e More GC fixes. Most notably, mark the thread object as not collectable, since it's hidden away in TLS where the GC can't find it.
GC now works well enough for LanguageKit to run.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33123 72102866-910b-0410-8b05-ffd578937521
2011-05-26 13:24:13 +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
8a5f6fd2d5 Added ChangeLog entry from last commit
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33110 72102866-910b-0410-8b05-ffd578937521
2011-05-25 11:16:14 +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
e32626abe7 try to cope better with apps which leak autorelease pools.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33099 72102866-910b-0410-8b05-ffd578937521
2011-05-24 10:52:25 +00:00
Richard Frith-MacDonald
afc2ef7de8 fix main bundle path
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33088 72102866-910b-0410-8b05-ffd578937521
2011-05-23 10:51:58 +00:00
Richard Frith-MacDonald
55cd4ef60b quoted-printable fixes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33082 72102866-910b-0410-8b05-ffd578937521
2011-05-22 06:22:05 +00:00
Richard Frith-MacDonald
8c89a47a8b fix includes for gcc-4.6
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33069 72102866-910b-0410-8b05-ffd578937521
2011-05-19 08:19:24 +00:00
Richard Frith-MacDonald
df01b61d90 Minor thread-safety fix
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33029 72102866-910b-0410-8b05-ffd578937521
2011-05-12 18:14:40 +00:00
Richard Frith-MacDonald
ae8059e5c1 use errno.h for thread safety
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33028 72102866-910b-0410-8b05-ffd578937521
2011-05-12 16:08:10 +00:00
Richard Frith-MacDonald
b2649e0526 old/new objc api updates
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33027 72102866-910b-0410-8b05-ffd578937521
2011-05-12 16:03:08 +00:00
Fred Kiefer
ac3f2c5095 Fix keyed decoding for GSMutableArray and GSPlaceholderArray.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33026 72102866-910b-0410-8b05-ffd578937521
2011-05-12 08:24:15 +00:00
Richard Frith-MacDonald
effa0292d8 tolerate missing/incorrect character encoding declarations
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33012 72102866-910b-0410-8b05-ffd578937521
2011-05-09 11:35:00 +00:00
David Chisnall
91b513bfa8 Added test for creating class / adding methods. Based on Wolfgang Lux' test example.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32997 72102866-910b-0410-8b05-ffd578937521
2011-05-07 09:50:42 +00:00
David Chisnall
16fc1c503c Remove spurious &s
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32985 72102866-910b-0410-8b05-ffd578937521
2011-05-05 11:25:12 +00:00
Richard Frith-MacDonald
8f17e19b0d tweak to handle concurrency failure better.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32974 72102866-910b-0410-8b05-ffd578937521
2011-05-03 19:39:08 +00:00
Eric Wasylishen
5bc5e9a64b * Source/Additions/GSObjCRuntime.m (GSSelectorFromNameAndTypes):
With gcc 4.6 libobjc, GSSelectorFromNameAndTypes was calling some
functions like sel_get_any_typed_uid that were not declared (they're
declared in objc/objc-api.h which cannot be imported). I had to copy
over these function declarations, otherwise incorrect function calls
are generated which corrupt selectors (at least on x86-64).



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32968 72102866-910b-0410-8b05-ffd578937521
2011-05-02 20:10:54 +00:00
Richard Frith-MacDonald
7858806cfa Cleanup/simplify for readability and fix bug copying new ivars
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32966 72102866-910b-0410-8b05-ffd578937521
2011-05-02 09:02:02 +00:00
Quentin Mathe
77bf5ec8d9 Fixed OrderedSymbolDeclarations.plist writing to take in account that existing
.gsdoc files are usually not regenerated.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32962 72102866-910b-0410-8b05-ffd578937521
2011-04-30 15:41:08 +00:00
David Chisnall
2c900743bd Made initialize test abort if it deadlocks for too long.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32950 72102866-910b-0410-8b05-ffd578937521
2011-04-29 14:59:24 +00:00
David Chisnall
7446414424 On closer inspection, the runtimes / compilers were doing the right thing - the type encoding provided in Apple's documentation was wrong.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32945 72102866-910b-0410-8b05-ffd578937521
2011-04-29 11:11:37 +00:00
David Chisnall
cb845565ba Added test for property attribute encodings. These are based on the Apple documentation here:
http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/ocrtPropertyIntrospection.html

Several of the things in the documentation are wrong:

- The encoding of structures does not include the field names in property
  encodings.  This encoding format appears to only be used in ivars (yes, it is
  frustrating)

- Apple appears to encode long as q on LP64 platforms.  This is probably a
  compiler bug.

- The N flag is not set for non-atomic properties.  This appears to be a clang
  bug, since the non-atomic flag is not set in the AST - both the Mac and
  GNUstep runtimes generate the same wrong result.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32944 72102866-910b-0410-8b05-ffd578937521
2011-04-29 10:50:00 +00:00
David Chisnall
a95b18e430 Added missing ivar access functions.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32939 72102866-910b-0410-8b05-ffd578937521
2011-04-28 18:41:01 +00:00
Eric Wasylishen
ff0b5abd62 * Source/NSNumberFormatter.m: Move the body of -init to a method called
-_NSNumberFormatterInit, and call this in -initWithCoder: so that
instances created with -initWithCoder: are initialized correctly.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32931 72102866-910b-0410-8b05-ffd578937521
2011-04-27 02:43:03 +00:00
Eric Wasylishen
8a890d9926 * Headers/Foundation/NSObjCRuntime.h: Add CGFLOAT_MIN and CGFLOAT_MAX
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32929 72102866-910b-0410-8b05-ffd578937521
2011-04-26 23:43:05 +00:00
David Chisnall
5d5b46a135 Added NSInteger range constants (OS X compat).
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32918 72102866-910b-0410-8b05-ffd578937521
2011-04-21 11:06:18 +00:00
David Chisnall
d17fe8eab0 Added test for correct behaviour of +initialize in a multithreaded environment.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32912 72102866-910b-0410-8b05-ffd578937521
2011-04-20 09:41:12 +00:00
David Chisnall
d190709e05 After going to all of the effort of recomputing the frame size, actually store the one that we compute instead of accidentally discarding it.
It would probably be a good idea if we skipped the entire disassemble / reassemble code path if we've got sensible method encoding strings.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32908 72102866-910b-0410-8b05-ffd578937521
2011-04-19 16:26:09 +00:00
David Chisnall
7c427b04d6 __objc_responds_to() -> class_respondsToSelector().
No functionality change, just a switch to using the portable public functions.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32863 72102866-910b-0410-8b05-ffd578937521
2011-04-14 18:04:50 +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
Adam Fedor
248f5eb94c Bump version to unstable
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32851 72102866-910b-0410-8b05-ffd578937521
2011-04-14 03:03:24 +00:00
Adam Fedor
f9a09fa60b Version 1.22.0
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32845 72102866-910b-0410-8b05-ffd578937521
2011-04-14 02:38:09 +00:00