Commit graph

98 commits

Author SHA1 Message Date
theraven
354c8b3e5a Lazily initialize POSIX threads, matching OS X behaviour and stopping us from crashing when calling autorelease from a thread that was not previously registered explicitly (yuck!)
Also do some quite hacky (and not totally correct) things to try to make sure that we aren't confused into thinking that the first NSThread is the main thread, if it's created on a separate thread.  Currently only supported on FreeBSD and OpenBSD.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33521 72102866-910b-0410-8b05-ffd578937521
2011-07-11 14:31:36 +00:00
rfm
d70e36cea8 always create autorelease pools for mixed GC mode support
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33212 72102866-910b-0410-8b05-ffd578937521
2011-05-31 07:55:06 +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
theraven
2c9886b127 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
theraven
e50e12129e 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
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
d9f4c65624 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
rfm
1250bd6d77 add comments for clarification
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32697 72102866-910b-0410-8b05-ffd578937521
2011-03-24 06:24:05 +00:00
rfm
3b9be31642 add last night's changes based on static analyser results.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32507 72102866-910b-0410-8b05-ffd578937521
2011-03-09 10:24:18 +00:00
rfm
6386463fde simple implementation for gc
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32419 72102866-910b-0410-8b05-ffd578937521
2011-02-28 21:59:42 +00:00
rfm
d32eb0e985 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
rfm
f9f81837d6 Reduce internal class interdependency for improved maintainability.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32083 72102866-910b-0410-8b05-ffd578937521
2011-02-11 16:04:05 +00:00
rfm
7ff4d4c9c7 fixups for libobjc2
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29753 72102866-910b-0410-8b05-ffd578937521
2010-02-25 18:49:31 +00:00
rfm
e263f96f16 more header reorganisation
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29731 72102866-910b-0410-8b05-ffd578937521
2010-02-25 08:36:34 +00:00
rfm
53beb40301 deprecates some gnustep runtime wrappers
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29697 72102866-910b-0410-8b05-ffd578937521
2010-02-22 10:13:20 +00:00
rfm
d605c6f7b5 Simplify header inclusion
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29669 72102866-910b-0410-8b05-ffd578937521
2010-02-19 08:12:46 +00:00
rfm
9edbe1a4fc cosmetic tweaks
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29657 72102866-910b-0410-8b05-ffd578937521
2010-02-17 11:47:06 +00:00
rfm
f13d56d8ec merge back reorganisation branch
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29615 72102866-910b-0410-8b05-ffd578937521
2010-02-14 10:48:10 +00:00
rfm
56f4c389a0 thread termination fixups
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29461 72102866-910b-0410-8b05-ffd578937521
2010-02-01 21:08:45 +00:00
rfm
ab08a4642b Have -drain call -release
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28950 72102866-910b-0410-8b05-ffd578937521
2009-11-04 05:51:34 +00:00
rfm
4326b17dc6 implement -drain
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@27654 72102866-910b-0410-8b05-ffd578937521
2009-01-22 15:59:06 +00:00
fredkiefer
314a2da7de When a thread ends clear the autorelease pool cache of that thread and
not of the current one.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@26819 72102866-910b-0410-8b05-ffd578937521
2008-08-25 15:39:02 +00:00
rfm
e0711a3b8d allow developers more time to adapt to LGPLv3
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@26606 72102866-910b-0410-8b05-ffd578937521
2008-06-08 10:38:33 +00:00
rfm
f1d83b9f14 MacOS-X compatibility updates.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@26598 72102866-910b-0410-8b05-ffd578937521
2008-06-06 13:57:06 +00:00
rfm
f9b09da875 Use get_imp() to get method implementation
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@26359 72102866-910b-0410-8b05-ffd578937521
2008-03-19 08:57:14 +00:00
rfm
f1143aa518 MacOS-X compatibility tweaks
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@26345 72102866-910b-0410-8b05-ffd578937521
2008-03-18 13:55:46 +00:00
rfm
f77071d0b6 Use +instanceMethodForSelector: to cache method for class.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@26298 72102866-910b-0410-8b05-ffd578937521
2008-03-13 17:34:44 +00:00
rfm
c25817d6f0 Minor tweak to cope with EOFault
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@26258 72102866-910b-0410-8b05-ffd578937521
2008-03-10 11:09:40 +00:00
rfm
aa3dfae174 Add some diagnostics for memory management errors (deallocating a deallocated
object).


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@26085 72102866-910b-0410-8b05-ffd578937521
2008-02-18 09:59:16 +00:00
rfm
15ffb48291 NSThread updates and cleanup
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@25608 72102866-910b-0410-8b05-ffd578937521
2007-11-25 14:49:05 +00:00
rfm
cd46236028 Update to GPL3 and LGPL3
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@25482 72102866-910b-0410-8b05-ffd578937521
2007-09-14 11:36:11 +00:00
rfm
4d142796a2 Fix bug returning autorelease count.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@24434 72102866-910b-0410-8b05-ffd578937521
2007-01-30 18:05:34 +00:00
rfm
6ba4584136 More tidyups
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23914 72102866-910b-0410-8b05-ffd578937521
2006-10-19 13:51:19 +00:00
rfm
cefd7bacac Help avoid programs getting huge memory footprints when they don't need to.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23077 72102866-910b-0410-8b05-ffd578937521
2006-06-17 17:20:22 +00:00
rfm
e7962cfb4d avoid spurious compiler warnings
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23027 72102866-910b-0410-8b05-ffd578937521
2006-06-04 06:42:10 +00:00
CaS
767ed212c6 Fix unnecessary extra pool creation.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@22339 72102866-910b-0410-8b05-ffd578937521
2006-01-20 17:12:33 +00:00
CaS
7a186a7782 Catch autoreleased objects during thread exit.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@22333 72102866-910b-0410-8b05-ffd578937521
2006-01-19 06:15:27 +00:00
CaS
f57ca76cba Fixes for 64bit systems .. mostly cosmetic avoidance of compiler warnings.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@22282 72102866-910b-0410-8b05-ffd578937521
2006-01-10 10:29:11 +00:00
fedor
376e495dad * Update FSF Address.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@21245 72102866-910b-0410-8b05-ffd578937521
2005-05-22 03:32:16 +00:00
CaS
e2deb5cf61 Try to handle destruction of an autorelease pool more robustly.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@20860 72102866-910b-0410-8b05-ffd578937521
2005-03-06 15:08:12 +00:00
CaS
d05bb0584e Fix fosdem changes and a few bugs exposed by them.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@20811 72102866-910b-0410-8b05-ffd578937521
2005-02-28 17:18:54 +00:00
CaS
d650d89cb9 Fosdem updates.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@20805 72102866-910b-0410-8b05-ffd578937521
2005-02-27 10:46:19 +00:00
CaS
0708409c1b Tidy up use of white space so we have it after if/for/while and not after (
or before ) or padding at end of line.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@20773 72102866-910b-0410-8b05-ffd578937521
2005-02-22 11:22:44 +00:00
CaS
d2161f1c01 Revert an nsthread change and try to avoid memory leaks when autorelease
pools are created during the thread exit process.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@20287 72102866-910b-0410-8b05-ffd578937521
2004-11-03 13:20:39 +00:00
CaS
2c9279b422 Fix for inefficiency/leak in emptyPool
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@19789 72102866-910b-0410-8b05-ffd578937521
2004-07-29 10:54:55 +00:00
CaS
ec4bfb2956 Documentation improvements.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@19326 72102866-910b-0410-8b05-ffd578937521
2004-05-14 16:22:49 +00:00
ayers
73dc4cb9f6 Header reorganizsateion - Please refer to ChangeLog
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@17407 72102866-910b-0410-8b05-ffd578937521
2003-07-31 23:49:32 +00:00
CaS
2cc6bd5f1a Tidied
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@16923 72102866-910b-0410-8b05-ffd578937521
2003-06-15 05:24:07 +00:00
CaS
4a8264ac58 Documentation improvements.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@16922 72102866-910b-0410-8b05-ffd578937521
2003-06-15 05:18:27 +00:00
fedor
0e59d4552d Change syntax of includes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@16874 72102866-910b-0410-8b05-ffd578937521
2003-06-07 01:24:41 +00:00