Frederik Seiffert
f67c99dbcc
win32: initialize Windows Sockets in NSObject only
...
And update to Windows Socket version 2.2. Also clean up the DllMain initialization to handle CRT init errors and call _CRT_INIT also on DLL/thread detach, and remove uneeded .idata section after removing WSAStartup() import.
WSAStartup() should not be called from DllMain according to MS documentation. Fixes #186 .
2021-08-11 19:32:21 +02: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
Frederik Seiffert
843800d413
Add support for libobjc2 runtime in NSObject on Windows
2021-03-29 11:22:00 +02:00
Frederik Seiffert
0582eddd96
Export string constants and annotate exported function implementations
...
Moves scattered string constants to externs.m, and removes obsolete code replacing constant strings.
2021-03-27 17:36:15 +01:00
Riccardo Mottola
18dfe7b8f6
Windows linker doesn't really support WEAK symbols, not even with gcc10. binutils 2.3.5 fails to link because not all symbols were exported
2020-09-17 23:46:37 +02:00
Richard Frith-Macdonald
291ad8384e
move deallocation of zombie map outside lock protected section so that any exception while deallocating will not cause unbalanced lock/unlock
2020-07-09 09:11:47 +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
3f7d54a33f
improve reportingn of memory usage
2019-06-11 14:07:10 +01:00
Richard Frith-Macdonald
2425c42ace
Cosmetic tweaks to match coding style
2019-06-06 14:16:30 +01:00
Richard Frith-Macdonald
921f7521ff
improve thread safety when using zombies
2019-02-11 09:09:20 +00:00
Richard Frith-Macdonald
793e5cd5c9
portability tweak for lock initialisation
2018-05-29 10:36:50 +01:00
Richard Frith-Macdonald
5c7713cacc
Minor tidyups plus config update
2018-04-24 12:24:37 +01:00
Richard Frith-Macdonald
bb85bd426c
defer setting lock name to try to avoid crash on bsd
2018-04-10 20:27:05 +01:00
Richard Frith-Macdonald
82675cd3d9
more lock tracing tweaks
2018-03-26 16:35:17 +01:00
Richard Frith-Macdonald
43673452a5
locking debug/performance tweaks
2018-03-26 15:05:01 +01:00
Richard Frith-Macdonald
4efa322ca2
Fix bug in object allocation when ARC is available
2018-01-04 09:08:36 +00:00
Riccardo
ae335197f4
cleanup previous commit
2017-12-21 13:11:08 +01:00
Riccardo
d28a000877
Compatibility for OS/compiler not supporting weak symbols
2017-12-21 08:34:46 +01:00
David Chisnall
25e67bd107
Refactor weak symbol usage.
...
The Linux run-time linker doesn't allow weak references in one library
to be overridden by ones in another. To work around this, we now
declare the runtime functions as weak and perform dynamic checks on
whether the symbols have been resolved and call the fallbacks as local
static functions if they are not present.
2017-12-17 10:57:25 +00:00
David Chisnall
e35eb61dbc
Make object allocation and deallocation use the runtime.
...
All objects are now created and destroyed by the runtime, so we have
clean layering between -base and libobjc.
2017-12-13 18:22:08 +00:00
David Chisnall
c3921ee1f7
Refactor refcount usage.
...
This makes it easier for the runtime to change how reference counts are
stored by removing any refcount manipulation from -base when the runtime
provides accessors. This should have no functionality change with
existing runtimes, but will let newer runtimes drop in alternative
representations easily.
2017-12-13 17:19:43 +00:00
Richard Frith-Macdonald
cc2ee1d59b
Improve diagnostic if reference count is incremented too far.
2017-07-03 14:33:32 +01:00
Richard Frith-MacDonald
af09204ffb
typdef for refcount when no atimics available
...
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@40225 72102866-910b-0410-8b05-ffd578937521
2016-11-18 06:49:16 +00:00
Richard Frith-MacDonald
e0267770ef
fix crash and other memory management tweaks
...
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@40196 72102866-910b-0410-8b05-ffd578937521
2016-11-08 10:21:00 +00:00
Niels Grewe
fe155240e7
Re-enable fast-ARC mode when possible.
...
Define _ARCCompliantRetainRelease on 32bit platforms and when
we have copmiler intrinsics for atomic operations that allow us
to extend the refcount field to match libobjc2.
The effective maximum reference count is still 2^24 - 1 in either
case.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@40183 72102866-910b-0410-8b05-ffd578937521
2016-10-28 08:30:16 +00:00
Wolfgang Lux
4cdf4004e8
Don't tell a lie. The retain count representation of gnustep-base and
...
libobjc2 differs, so we cannot use the ARC retain/release implementation
for now.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@40181 72102866-910b-0410-8b05-ffd578937521
2016-10-27 15:00:17 +00:00
Richard Frith-MacDonald
e43c12542a
Don't use windows atomics unless compiler ones aren't available
...
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39932 72102866-910b-0410-8b05-ffd578937521
2016-06-27 19:05:40 +00:00
Richard Frith-MacDonald
0c7237ec08
s390x portability fixes
...
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39901 72102866-910b-0410-8b05-ffd578937521
2016-06-22 07:54:16 +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
4a6d6225b9
tidied
...
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39738 72102866-910b-0410-8b05-ffd578937521
2016-05-10 17:03:02 +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
e27363d97d
Don't initialise NSUserDefaults in NSObject+initialize ... recursion on bsd
...
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39393 72102866-910b-0410-8b05-ffd578937521
2016-02-18 06:56:44 +00:00
Richard Frith-MacDonald
91d3484e9b
fix typo in comment
...
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39022 72102866-910b-0410-8b05-ffd578937521
2015-10-03 17:11:00 +00:00
Richard Frith-MacDonald
fa3b26e91c
improve logging of sending bad selector to be performed
...
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39021 72102866-910b-0410-8b05-ffd578937521
2015-10-03 16:56:07 +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
13e4d77cec
fix hash generation for 64bit processors
...
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38294 72102866-910b-0410-8b05-ffd578937521
2015-01-16 14:29:38 +00:00
Richard Frith-MacDonald
4101cadd82
mips fix bug #42693
...
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37990 72102866-910b-0410-8b05-ffd578937521
2014-07-13 07:31:33 +00:00
Quentin Mathe
354ab0f46f
Fixed -respondsToSelector: and +instancesRespondToSelector: to check
...
+resolveInstanceMethod: and +resolveClassMethod: as documented in Cocoa
NSObject API.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37614 72102866-910b-0410-8b05-ffd578937521
2014-01-18 16:04:34 +00:00
Richard Frith-MacDonald
3a895af609
Fix zombie creation for new runtime with hidden class for associated objects
...
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37553 72102866-910b-0410-8b05-ffd578937521
2014-01-07 11:09:05 +00:00
Richard Frith-MacDonald
e9ff4f3a3c
Fix for bug #41111
...
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37551 72102866-910b-0410-8b05-ffd578937521
2014-01-07 10:41:49 +00:00
Richard Frith-MacDonald
9944f1823f
attempt to fix #39125
...
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37479 72102866-910b-0410-8b05-ffd578937521
2013-12-20 10:45:52 +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
4551738b6f
tweak guess of reasonable padding/alignment size when not provided by compiler
...
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@36876 72102866-910b-0410-8b05-ffd578937521
2013-07-12 06:35:32 +00:00
Richard Frith-MacDonald
51ff14a945
Alignment fixup
...
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@36845 72102866-910b-0410-8b05-ffd578937521
2013-07-06 07:48:26 +00:00
Richard Frith-MacDonald
d65b9254dd
minor fixes
...
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@36839 72102866-910b-0410-8b05-ffd578937521
2013-07-05 20:31:54 +00:00
Richard Frith-MacDonald
05bf612939
Suppress unwanted compiler warning by using clang-specific pragmas only when compiling with clang.
...
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@36811 72102866-910b-0410-8b05-ffd578937521
2013-07-03 06:50:26 +00:00