Commit graph

230 commits

Author SHA1 Message Date
Richard Frith-Macdonald
0b1a2d4d66 Tidy positioning of semicolon to be inside IF_NO_ARC() macros so it won't appear in the source when compiled with ARC 2022-02-17 10:21:36 +00:00
Richard Frith-Macdonald
c76ebf2962 Replaced IF_NO_GC() macro calls with the more descriptive IF_NO_ARC()
and deprecate it.  Searched for and removed obsolete references to
garbage collection in comments and documentation.
2022-02-17 10:08:18 +00:00
Levin Li
5b151c5fa0 Do not call handler blocks if they are nil 2021-11-23 18:34:34 +08:00
Frederik Seiffert
abfe4e2a04 Use native threading and locking APIs on Windows
Removes dependency on pthread library and uses fast Slim Reader/Writer (SRW) locks for NSLock/NSRecursiveLock/NSCondition/NSConditionLock as well as all internal locks. Adds GS_MUTEX_*() macros in GSPThread.h, that are being used for all internal locking instead of pthread APIs.

Also adds support for thread priorities on Windows, fixes method signature of +[NSThread setThreadPriority:] to match Apple platforms, and adds error handling in same method.
2021-07-29 14:22:27 +02:00
Gregory John Casamento
753c907938 Fix address for FSF and License name in all headers in base 2019-12-09 18:36:00 -05:00
Frederik Seiffert
561cef3797 Perform non-concurrent block enumeration in place.
Was previously using serial queue, which doesn't match Apple platforms.
2019-10-23 17:44:53 +02:00
Richard Frith-Macdonald
ae95e859d6 fix crash when removing an array from itself 2019-09-25 09:54:59 +01:00
Gregory John Casamento
458958554b Fixed test 2019-07-02 01:00:41 -04:00
Gregory John Casamento
688d409c4b Merge branch 'master' of github.com:gnustep/libs-base into add_nsorderedset_classcluster 2019-06-28 20:14:56 -04:00
Richard Frith-Macdonald
3f7d54a33f improve reportingn of memory usage 2019-06-11 14:07:10 +01:00
Gregory John Casamento
5287a62909 Add skeletal implementation of keysSortyedByValue*** methods 2019-05-20 22:23:20 -04:00
Richard Frith-Macdonald
72ad2656c8 don't create NSLock instances during initialisation 2018-04-12 18:21:19 +01:00
Richard Frith-Macdonald
9bbcd75d16 Fix for failure to check insertion point is at an existing item. 2017-11-16 14:56:20 +00:00
Richard Frith-MacDonald
8a9d9597b0 tweaks
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39779 72102866-910b-0410-8b05-ffd578937521
2016-05-19 07:21:36 +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
a0c97c1ddd deprecate confusing extension in favour of simpler ARC-complient method
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39520 72102866-910b-0410-8b05-ffd578937521
2016-03-10 16:50:41 +00:00
Richard Frith-MacDonald
a51249a65d Apply patch by Patrick Laurent and tidy a bit.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39411 72102866-910b-0410-8b05-ffd578937521
2016-02-24 07:41:20 +00:00
Riccardo Mottola
cb977b3915 Minor cast fixes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38855 72102866-910b-0410-8b05-ffd578937521
2015-08-05 08:34:49 +00:00
Richard Frith-MacDonald
5cbc47a238 minor performance tweaks
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38805 72102866-910b-0410-8b05-ffd578937521
2015-07-16 09:30:57 +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
4bce4d2978 Various updates
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38599 72102866-910b-0410-8b05-ffd578937521
2015-06-04 09:18:52 +00:00
Riccardo Mottola
9eac37b9c8 Add firstObject: method existing since 10.6
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38595 72102866-910b-0410-8b05-ffd578937521
2015-06-01 17:43:37 +00:00
Richard Frith-MacDonald
60a0f7ce5b minor fixes for 64bit systems using collection with more than 2^32 items
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38295 72102866-910b-0410-8b05-ffd578937521
2015-01-16 15:25:50 +00:00
Richard Frith-MacDonald
777f693855 safety tweak suggested by Quentin
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37564 72102866-910b-0410-8b05-ffd578937521
2014-01-09 09:55:36 +00:00
Richard Frith-MacDonald
6475418c5e Don't set mutations pointer to on-stack value which could randomly get set
to contain garbage ... use self instead.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37563 72102866-910b-0410-8b05-ffd578937521
2014-01-09 09:00:24 +00:00
Fred Kiefer
32a9c4c1dd * Headers/Foundation/NSArray.h,
* Source/NSArray.m: Move -setValue:forKey: from NSMutableArray
  to NSArray.
Patch by Marcian Lytwyn <marcian.lytwyn@advcsi.com>.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37464 72102866-910b-0410-8b05-ffd578937521
2013-12-13 21:01:22 +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
55149fdc40 Memory management nad documentation fixes.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@35584 72102866-910b-0410-8b05-ffd578937521
2012-09-21 10:27:05 +00:00
Richard Frith-MacDonald
cc42a0110d formatting/coding style fixups
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@35574 72102866-910b-0410-8b05-ffd578937521
2012-09-19 14:20:01 +00:00
Niels Grewe
f8fd11f3fd Completely overhaul how we do sorting in -base. GSSorting.h now defines an
interface that can be used for all sorting tasks in the library. The actual sort
algorithms to use are now plugable. Timsort is the new default sorting
algorithm, the existing algorithms, shellsort and quicksort, can still be
selected using a configure switch.

Also implement the new NSComparator (blocks) based sorting and insertion index
searching methods for NSMutableArray and NSArray.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@35573 72102866-910b-0410-8b05-ffd578937521
2012-09-19 13:31:09 +00:00
David Chisnall
3cb1b08b26 Support for collection subscripting (NSArray and NSDictionary).
Yes, the syntax is ugly, but no doubt people will start using it in June...



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@35033 72102866-910b-0410-8b05-ffd578937521
2012-04-06 12:23:10 +00:00
Niels Grewe
fa47f6da10 Detect the presence of libdispatch and, if available, use it for collection
enumeration methods that take blocks as arguments. This allows us to implement
the NSEnumerationConcurrent option of those methods with minimal effort.

The searching methods on NSIndexSet and all the sorting methods are still
missing.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@35010 72102866-910b-0410-8b05-ffd578937521
2012-03-27 17:05:19 +00:00
Fred Kiefer
e7d5480cd1 * Source/NSArray.m (-objectsAtIndexes:): Fix comparision of
unsigned variable with NSNotFound.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@34389 72102866-910b-0410-8b05-ffd578937521
2012-01-02 15:07:32 +00:00
David Chisnall
d2ea054c26 Lots of little fixes to make -base compile with -Werror (now builds without warnings).
Richard: I'm unsure about three of these, which were fixes in memset() calls in:
- NSConcreteMapTable.m
- NSConcreteHashTable.m
- Additions/NSData+GNUstepBase.m

Please can you check them?  I think they are intended to zero the entire object
(rather than the first word), but the lack of comments makes me unsure.

Most changes were just tweaks to variable types.  I've also removed some dead code from NSInvocation.  This was small group of things that were marked for internal use only, but not actually referenced in the code anywhere.

Other improvements:

- NSArray / NSDictionary fixed up to use the 10.7 (ARC-friendly) prototypes.
- getObjects:andKeys: implemented for NSDictionary (10.5 method)
- NSPointerArray and NSHashTable now properly support weak objects.
- Tests for weak objects in collections.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33621 72102866-910b-0410-8b05-ffd578937521
2011-07-24 13:09:22 +00:00
David Chisnall
d323a291d8 Change id* -> id[] for OS X 10.7 compatibility in NSArray. This change is required for ARC: now, id* means pointer to a single object, id[] means array.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33607 72102866-910b-0410-8b05-ffd578937521
2011-07-22 16:07:23 +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
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
David Chisnall
cd09e6bf87 Remove redundant copy + leak in NSArray.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32080 72102866-910b-0410-8b05-ffd578937521
2011-02-11 15:13:48 +00:00
Richard Frith-MacDonald
60885954c6 Recommit tested changes.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32075 72102866-910b-0410-8b05-ffd578937521
2011-02-11 14:31:25 +00:00
Richard Frith-MacDonald
336c7bf021 Revert back to working code!
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32072 72102866-910b-0410-8b05-ffd578937521
2011-02-11 13:53:54 +00:00
Richard Frith-MacDonald
f3f69cccc2 get things to compile again
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32071 72102866-910b-0410-8b05-ffd578937521
2011-02-11 13:05:48 +00:00
David Chisnall
acf11e142d Fix NSEnumerationReverse in the other place where this bug was pasted. I must have been asleep or drunk when I wrote this method.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32055 72102866-910b-0410-8b05-ffd578937521
2011-02-11 11:31:41 +00:00
David Chisnall
8c06de29c6 Fix [NSArray -indexesOfObjectsWithOptions:passingTest:] with NSEnumerationReverse option. Was doing forward iteration in all cases.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32054 72102866-910b-0410-8b05-ffd578937521
2011-02-11 11:29:34 +00:00
Richard Frith-MacDonald
9eb046056c tweaks for clang static analyser warningS
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32048 72102866-910b-0410-8b05-ffd578937521
2011-02-11 09:02:33 +00:00
Richard Frith-MacDonald
15f4308a20 various bugfixes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@30732 72102866-910b-0410-8b05-ffd578937521
2010-06-15 11:26:00 +00:00
Richard Frith-MacDonald
4da5c940ab revert reversion ... i was wrong about jigs
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@30150 72102866-910b-0410-8b05-ffd578937521
2010-04-14 10:39:05 +00:00
Richard Frith-MacDonald
0017de868c revert change which broke jigs
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@30147 72102866-910b-0410-8b05-ffd578937521
2010-04-14 09:18:12 +00:00
Richard Frith-MacDonald
cfa8831721 osx compatibility tweak.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@30140 72102866-910b-0410-8b05-ffd578937521
2010-04-13 18:37:09 +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