Commit Graph

94 Commits

Author SHA1 Message Date
theraven
fce7c776b6 Tweak build to only enable optimisation in non-debug builds. 2011-07-04 14:44:04 +00:00
theraven
bc87ed22e1 Implemented support for __weak with ARC.
ARC functions are all now exposed in a header, but not yet documented.  See the ARC ABI spec for now:

http://clang.llvm.org/docs/AutomaticReferenceCounting.html#runtime
2011-06-29 13:12:02 +00:00
theraven
b5380d50d3 Added support for ARC.
Weak references are still not supported, but code that doesn't use them (i.e. any code that wants to be compatible with OS X 10.6) will work fine.

The current implementation is VERY inefficient and has a large number of missed optimisation opportunities: this is the 'make it right' phase, and should be almost equivalent to explicit retain / release code.
2011-06-28 16:29:42 +00:00
theraven
fbdfc0b9eb Allow packagers to more easily rename the library.
Patch by Sebastian Reitenbach!
2011-06-23 10:30:56 +00:00
theraven
b296b18571 Improvements to GC mode:
- Add objc_gc_collectable_address() to determine whether a pointer is managed
  by the GC

- If LIBOBJC_CANARIES is set (optionally to a random number seed) then store a
  canary value after every allocation returned by
  objc_gc_allocate_collectable() and, when it is finalised, check that the
  canary has not been modified, aborting if it has.  This catches some
  heap-buffer overflows, and currently causes GNUstep to abort.

- If LIBOBJC_LOG_ALLOCATIONS is set to a file name, log all GC-managed
  allocations to that file.  This gives something like malloc_history on OS X.

- objc_memmove_collectable() now guarantees that all copied pointers remain
  visible to the GC at all times (which was the point of the function - the
  original implementation was just a quick stub).
2011-05-29 21:28:27 +00:00
theraven
6d78040180 Initial support for running finalizers in a separate thread. 2011-05-28 13:07:11 +00:00
thebeing
e661e203d4 Re-enable function inlining. 2011-05-27 19:12:18 +00:00
thebeing
1653751263 Use -lgc on linux platforms. 2011-05-27 18:11:53 +00:00
theraven
c6fc399a73 Enable GC support by default. You can still turn it off with boehm_gc=no. 2011-05-26 14:25:15 +00:00
theraven
e05c9c2ff5 More GC fixes 2011-05-26 13:28:31 +00:00
theraven
fcc47bc7ce Fix building without GC support. Still need to make sure that some of the GC functions always work, since they are expected to be no-ops in non-GC mode. 2011-05-25 12:25:27 +00:00
theraven
929f8f95b4 Improved a few GC functions.
Added objc-auto.h header, providing (documented) public interfaces to this
functionality.
2011-05-23 11:11:51 +00:00
theraven
ad16172625 First pass at implementing Apple-compatible GC using Boehm. Still needs some tidying, but the following work:
- __strong pointers, preventing objects from being freed

_ __weak pointers are automatically freed when the last remaining __strong pointer goes away

- objc_gc_{retain,release}_np() functions, which can be used to implement CFRetain() and CFRelease() (adds an reference count - the object will not be collected until after its last retain is gone.
2011-05-22 23:02:04 +00:00
theraven
d12de81cd6 Remove opts from default build - they must now be explicitly built.
Don't crash if objc_disposeClassPair() is called on a class that is not get
registered with the runtime.
2011-05-04 12:53:04 +00:00
theraven
12385fcb1e Tidy up low memory profile to use slots directly. 2011-04-28 11:59:18 +00:00
qmathe
bd48461fb9 Fixed GNUmakefile to ensure legacy symbols are visible 2011-04-22 12:02:56 +00:00
theraven
928e7f3971 Try again... 2011-04-22 11:51:15 +00:00
theraven
6d112bb632 Don't accidentally default to compiling without legacy compat. 2011-04-22 11:45:44 +00:00
theraven
649ce9dd7f Updated release announcement.
Made the LLVM optimisations build by default (if LLVM is installed).
2011-04-22 11:38:16 +00:00
theraven
789219a2cb Expose the low memory profile as an option in the dtable. 2011-04-19 10:55:59 +00:00
theraven
d7056f6de2 Simplify @synchronize() and improve efficiency (space and time). 2011-04-17 18:04:58 +00:00
theraven
24de067017 Default to building without the legacy APIs, now GNUstep doesn't require them. 2011-04-15 12:08:49 +00:00
theraven
e198597bd3 Added support for associative references. Modified sync code to use this. 2011-04-15 11:20:37 +00:00
theraven
d51500184c More cleanups. Stop using __ identifiers for internal stuff now that it's properly marked private and we don't have to worry about conflicts. 2011-04-14 16:44:34 +00:00
theraven
c2f572f9a1 Set the makefiles in trunk back to non-release mode. 2011-04-14 09:51:49 +00:00
theraven
b76b4be925 Disable selector type mismatch warnings, for the release. 2011-04-14 08:38:55 +00:00
thebeing
901c3b6a1c Fix linking libobjcxx when libobjc has not yet been installed. 2011-04-08 14:48:43 +00:00
theraven
95ef5a93f9 Always use the first version of a class that's loaded twice until the merging code is a bit better tested. 2011-04-08 09:11:21 +00:00
theraven
23b26820f5 Make it easier to suppress mismatched selector warnings. It's useful for the runtime to tell you when your code is bad. Not so useful for it to tell you when someone else's code is bad... 2011-04-06 18:17:18 +00:00
theraven
600e970dea Separate ObjC++ support out into libobjcxx. Now code that doesn't need ObjCXX support can safely ignore it again. 2011-04-05 17:21:30 +00:00
theraven
7e71ffe24d Use correct pthread flag on OpenBSD.
Patch by Sebastian Reitenbach!
2011-04-04 22:21:13 +00:00
theraven
06ff4be6a9 More build system tidies. 2011-04-04 12:01:58 +00:00
theraven
496c66bd0b Fix linker errors. 2011-04-04 10:32:00 +00:00
thebeing
ee7817cf57 Implement a hook that allows the compiler to register the aliases used with the
@compatibility_alias directive so that they can be resolved at runtime.
2011-03-25 20:01:43 +00:00
theraven
ed9d0f33c9 Actually install the header that's referenced. 2011-03-22 20:53:16 +00:00
theraven
7e465eb325 Tweak building without ObjC++ support a bit. 2011-03-21 17:44:51 +00:00
theraven
73e1e2934b It turns out that Apple chose some confusing and non-intuitive semantics for
catching Objective-C objects in C++ catch statements (i.e. they follow
Objective-C semantics, not C++ semantics, irrespective of whether you use C++
or ObjC syntax).  We now default to Apple-compatible behaviour, but provide a
function that allows users to select the sane semantics if they prefer.

Added a capability bit for the unified exception model, so code can require it.
This is not really required, since any code using it will link against the
ObjC++ personality function and will get a linker failure if it isn't supported.

Also enabled Objective-C++ stuff by default.  This adds a dependency on the C++
standard library (actually on libsupc++, but GNUstep Make wants to link against
libstd++ anyway), which is not ideal.  It can be disabled with:

$ gmake objectiver-cxx=no

I suggest that this is only done by people who know that they will never want
Objective-C++ support.
2011-03-21 17:39:06 +00:00
theraven
e0719a9c62 Added Objective-C++ exception handling support. Allows throwing Objective-C objects with throw or @throw and catching them with catch() or @catch. 2011-03-20 20:38:12 +00:00
theraven
df4570b90e Change language dialect to gnu99 from c99 - earlier commit required this, but I
forgot to commit the GNUmakefile change.  Note: the anonymous structure field
extension that requires this is part of C1X, so we can probably change this to
--std=c11 once C1X is actually finalised.
2011-03-16 16:22:08 +00:00
theraven
8db63b976f Initial work on developer mode (allows classes to be replaced at run time with new versions, by cooperating IDEs). This support is part of ongoing work to provide fix-and-continue functionality with Clang / Cling and LanguageKit. 2011-01-15 12:37:02 +00:00
theraven
4ab4b4033b Bumped version to 1.1 2011-01-10 15:08:52 +00:00
theraven
a83428b883 Move toydispatch into libobjc2.
Some build system tidies.

Add -retain / release to Protocol.

Initial work on clang-specific makefile.
2010-10-26 15:44:43 +00:00
theraven
ee32f78b0a Tweaked the GNUmakefile to (more or less) work with gcc.
Fixed block introspection for the new (Apple-compatible) ABI.
2010-10-01 13:11:48 +00:00
ericwa
39b0655877 libobjc2: another makefile hack to get mingw to declare strdup 2010-09-29 04:17:50 +00:00
ericwa
56341816a5 libobjc2: Makefile hack to get the __sync_* GCC builtins to work on Windows 2010-09-29 02:07:51 +00:00
rmottola
c7673659bb added package information to the makefile 2010-09-22 10:37:10 +00:00
ericwa
9e64fb7828 undo accidentally commited stuff 2010-09-16 04:57:56 +00:00
ericwa
dbb8ea2090 add deprecated sel_eq function for compatibility 2010-09-16 04:53:16 +00:00
theraven
033676b9e7 Enable type-dependent dispatch by default. Stack corruption is bad, m'kay? 2010-09-14 16:02:29 +00:00
theraven
00004fe5f3 More tweaks to the GNU-compatibility encoding stuff. This API is too broken to use, but GNUstep seems to want it. 2010-09-09 12:00:19 +00:00