Commit graph

94 commits

Author SHA1 Message Date
rfm
6c43f6c831 iFixup trace function type/name 2024-08-06 20:17:05 +01:00
rfm
04f0d76904 Fix use of obsolete/deprecated method. 2024-07-31 10:24:04 +01:00
rfm
d49b6a46ce Debug improvements 2024-06-21 16:43:50 +01:00
rfm
4d0b00776c Memory leak improvments 2024-06-18 11:23:15 +01:00
rfm
58ae7db59a fixup headers for deletion of obsolete lock code 2024-05-30 11:06:23 +01:00
Steven R. Baker
7525d942b7 Add the NSDebugEnabled boolean 2021-11-30 21:14:29 +00: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
Richard Frith-Macdonald
feac65a23f Fix use of potentially invalid value from heap 2020-10-24 17:54:55 +01: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
Marcus Müller
5bfbf62f06 Guard inclusion of <malloc.h> as to not break FreeBSD 2019-08-16 01:11:18 +02:00
Richard Frith-Macdonald
dd36855923 Improved memory usage reporting mechanisms 2019-08-08 17:20:25 +01:00
Richard Frith-Macdonald
ebfe915619 Fixups for stack handling 2018-03-27 07:06:17 +01:00
Richard Frith-Macdonald
82675cd3d9 more lock tracing tweaks 2018-03-26 16:35:17 +01:00
Richard Frith-MacDonald
6f1ac918fa msys2/64bit fixes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39942 72102866-910b-0410-8b05-ffd578937521
2016-06-28 14:01:55 +00:00
Richard Frith-MacDonald
5cf471c70f add fallbacks for string conversion
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39852 72102866-910b-0410-8b05-ffd578937521
2016-06-08 11:29:38 +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
62d2bcbabc changes for use of _WIN32 define on windows
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39492 72102866-910b-0410-8b05-ffd578937521
2016-03-09 13:16:16 +00:00
Richard Frith-MacDonald
a7f869790b fix comparison function return values
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39401 72102866-910b-0410-8b05-ffd578937521
2016-02-19 15:57:04 +00:00
Richard Frith-MacDonald
d87aacee2f fdix minor buglet
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38774 72102866-910b-0410-8b05-ffd578937521
2015-07-09 11:44:20 +00:00
Richard Frith-MacDonald
7a001daabc improve memory allocation statistics report
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38773 72102866-910b-0410-8b05-ffd578937521
2015-07-09 11:37:37 +00:00
Richard Frith-MacDonald
b5a6e5c255 minor optimisation
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38534 72102866-910b-0410-8b05-ffd578937521
2015-05-24 20:10:49 +00:00
Richard Frith-MacDonald
7f37b6668d Improve memory management debug functionality
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37873 72102866-910b-0410-8b05-ffd578937521
2014-05-09 08:04:58 +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
b71fde4e19 fix potential null pointer deref
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@36840 72102866-910b-0410-8b05-ffd578937521
2013-07-05 20:47:41 +00:00
Richard Frith-MacDonald
32fc733268 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
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
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
218582e63c more bsd tweaks
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32485 72102866-910b-0410-8b05-ffd578937521
2011-03-07 15:34:06 +00:00
Richard Frith-MacDonald
542df716ec get return address better on sparc etc.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32476 72102866-910b-0410-8b05-ffd578937521
2011-03-06 14:23:57 +00:00
Richard Frith-MacDonald
98c91159d9 return address tweak
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32471 72102866-910b-0410-8b05-ffd578937521
2011-03-06 10:09:37 +00:00
Richard Frith-MacDonald
d18e29dde8 avoid compiler warnings
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32417 72102866-910b-0410-8b05-ffd578937521
2011-02-28 19:49:57 +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
7a80adeb9b A huge blob of changes to make -base build with libobjc2, without using the old libobjc2 headers.
Most of these changes involve simply removing direct manipulation of any runtime structures and replacing them with runtime function calls.  For example class->name becomes class_getName(class) and so on.

libobjc2, like the Apple runtime, the NeXT runtime, and every version of the Objective-C spec, calls the class pointer in id isa.  A few files now have #define class_pointer isa at the top.  This line replaces class_pointer in the old GNU libobjc headers with isa so either class_pointer or isa can be used for accessing the class of an object.  Note: object_getClass() should be used in most cases because, in some future version of the runtime, this will skip things like lock classes and other hidden classes (e.g. KVO classes).

All of the old forwarding stuff has been removed.  Most of this stuff followed convoluted code paths that ended with an exception.  A few simply broke in exciting ways.  Hopefully no one has used them for the last ten years or so, but we can bring them back with some #ifndef stuff if they're really needed by anyone.

There is currently a bug in configure, which prevents dladdr() from being detected, so you need to manually tweak config.h to build - I have not fixed the fall-back code in objc-load.m to work with libobjc2, I just added a new version that uses the loader's functionality directly.  

Although -base now builds, it builds with a lot of warnings.  <string.h> is missing from a lot of files, so memcpy() and strlen() generate implicit function declaration warnings.  

Additionally, libobjc2 does still provide the sel_{get,register}_*() functions, but they're wrappers around the newer API ones.  These are deprecated and are not exposed in the headers.  Although they work, we should be replacing them with the libobjc2 versions as soon as possible.

This incorporates a patch by Eric.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@31265 72102866-910b-0410-8b05-ffd578937521
2010-09-09 15:06:09 +00:00
Richard Frith-MacDonald
f784646663 generalize define from __MINGW32__ to __MINGW__
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@30001 72102866-910b-0410-8b05-ffd578937521
2010-03-19 12:10:11 +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
85760d2563 move a bit more stuff into additions
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29666 72102866-910b-0410-8b05-ffd578937521
2010-02-18 16:18:54 +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
3cfdb02718 try using sigsetjmp
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28111 72102866-910b-0410-8b05-ffd578937521
2009-03-21 15:31:52 +00:00
Richard Frith-MacDonald
24d43481a8 Updates for 10.5 API changes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@27962 72102866-910b-0410-8b05-ffd578937521
2009-02-23 20:42:32 +00:00
Richard Frith-MacDonald
1ccdbc638c Portability fixes for 64bit intel.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@27930 72102866-910b-0410-8b05-ffd578937521
2009-02-20 17:44:58 +00:00
Richard Frith-MacDonald
952af9c197 garbage collection fixups
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@27578 72102866-910b-0410-8b05-ffd578937521
2009-01-12 12:48:46 +00:00
Richard Frith-MacDonald
c4a2f62ad0 Applied patch #6677
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@27080 72102866-910b-0410-8b05-ffd578937521
2008-11-17 13:45:32 +00:00
Richard Frith-MacDonald
5218659e48 consistency tweak
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@26989 72102866-910b-0410-8b05-ffd578937521
2008-10-29 06:47:46 +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
6eb2dd77a7 mingw fixup
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@26346 72102866-910b-0410-8b05-ffd578937521
2008-03-18 15:53:45 +00:00
Richard Frith-MacDonald
4c90ec5088 hould be fix for bug #22514
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@26315 72102866-910b-0410-8b05-ffd578937521
2008-03-16 18:17:49 +00:00
Richard Frith-MacDonald
bd4c02376c More stacktrace tweaks
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@25689 72102866-910b-0410-8b05-ffd578937521
2007-12-06 13:39:03 +00:00
Richard Frith-MacDonald
a92018afe3 Minor stack trace improvements.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@25688 72102866-910b-0410-8b05-ffd578937521
2007-12-06 11:40:17 +00:00
Richard Frith-MacDonald
9c36ec10dd Improved stacktrace/debug handling.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@25667 72102866-910b-0410-8b05-ffd578937521
2007-12-03 14:13:57 +00:00
Richard Frith-MacDonald
d6cfc0e91c Improve MacOS-X compatibility of headers.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@25638 72102866-910b-0410-8b05-ffd578937521
2007-11-29 20:53:26 +00:00