Commit graph

108 commits

Author SHA1 Message Date
Richard Frith-MacDonald
27899e4d66 patch by Larry Campbell plus removal of some garbage collection vestiges
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@40008 72102866-910b-0410-8b05-ffd578937521
2016-07-18 10:50:28 +00:00
Richard Frith-MacDonald
7622a2618e fix spelling errors / typos (patch by heintzmann.eric@free.fr)
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39774 72102866-910b-0410-8b05-ffd578937521
2016-05-18 06:11:00 +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
542825f621 Improve checks for attempted use of a deallocate/cached autorelease pool.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39708 72102866-910b-0410-8b05-ffd578937521
2016-04-29 07:31:48 +00:00
Richard Frith-MacDonald
51f4463702 Add check and exception for repeated deallocation of a pool.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39706 72102866-910b-0410-8b05-ffd578937521
2016-04-28 20:35:00 +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
04815b06fb fix for possible crash during thread exit
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38406 72102866-910b-0410-8b05-ffd578937521
2015-03-13 18:31:14 +00:00
Quentin Mathe
a396bc9f22 Fixed -emptyPool ARC_RUNTIME implementation not to push a pool to the cache,
-dealloc does it already.

The previous implementation could result in a pool being reused while still in 
use. 


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@35795 72102866-910b-0410-8b05-ffd578937521
2012-11-15 16:34:54 +00:00
David Chisnall
5e6e1ccde3 Fix a bug in the new autorelease pool implementation when pools are destroyed in the wrong order.
Test cast by Chris Armstrong!



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@35105 72102866-910b-0410-8b05-ffd578937521
2012-04-23 12:47:09 +00:00
David Chisnall
b9684ff5a7 Use the runtime's ARC autorelease pools if available.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@35031 72102866-910b-0410-8b05-ffd578937521
2012-04-06 12:02:59 +00:00
David Chisnall
6893ce1a95 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
Richard Frith-MacDonald
a69b7c2466 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
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
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
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
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
683386b6c6 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
Richard Frith-MacDonald
74eac99280 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
Richard Frith-MacDonald
b80266e49b 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
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
6f4f708a6f 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
Richard Frith-MacDonald
14b91c9052 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
Richard Frith-MacDonald
c07dc48eb3 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
Richard Frith-MacDonald
8769dd8b6f 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
Richard Frith-MacDonald
7cc69dfaae 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
Richard Frith-MacDonald
c8a6832349 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
Richard Frith-MacDonald
21d597e740 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
Richard Frith-MacDonald
b8ccc9459d 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
Richard Frith-MacDonald
02a93a74af 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
Richard Frith-MacDonald
94296c4747 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
Fred Kiefer
bff3fe7ca0 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
Richard Frith-MacDonald
b2b14398d2 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
Richard Frith-MacDonald
ec0b3ab41a 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
Richard Frith-MacDonald
4fb2f3c708 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
Richard Frith-MacDonald
50a244c4c2 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
Richard Frith-MacDonald
ef453e89d7 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
Richard Frith-MacDonald
368a16a5c8 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
Richard Frith-MacDonald
566d6ed569 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
Richard Frith-MacDonald
635c255ed2 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
Richard Frith-MacDonald
62559023b9 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
Richard Frith-MacDonald
bd0963b109 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
Richard Frith-MacDonald
0d0ae9d9a8 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
Richard Frith-MacDonald
db7cf4a3fc 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
Richard Frith-MacDonald
087e9db5e6 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
Richard Frith-Macdonald
7ee4008457 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
Richard Frith-Macdonald
178aecf1db 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
Richard Frith-Macdonald
06981169ed 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
Adam Fedor
fcc13ccd0f * 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
Richard Frith-Macdonald
7bd5f9b5b0 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