11 Commits (c73b7a2f0b9315ceb90a2d1ab0f6f343478d191c)

Author SHA1 Message Date
theraven c73b7a2f0b Mark all libobjc2 headers as system headers when not compiling the runtime
itself.  This makes clang hide warnings.
13 years ago
theraven 85272c48b9 Improve some comments, minor tweaks to GC. 15 years ago
theraven c9e54c382d Tweak auto-copy code. Now it only copies classes that are explicitly
registered to be copied on heap assignment.  By default, this is just
_NSConcreteStackBlock.  Other classes can be registered (LanguageKit should
register BlockClosure to make sure that Smalltalk works).

Fred: This makes the stuff that we discussed briefly at FOSDEM possible in GC
mode: We can allocate a GSStackEvent subclass of NSEvent on the stack.  If it
implements a -copy method that returns an NSEvent and is registered with the
runtime in this way, then any code that assigns it anywhere on the heap will
end up implicitly creating a heap copy.
15 years ago
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).
15 years ago
theraven d73eb8f634 Expose another function in the header. 15 years ago
theraven 898707bf94 Added function for getting reference count. 15 years ago
theraven 368bf3bd1d Add reallocate function. 15 years ago
theraven 88c075893f Call ObjC++ destructors when finalising an object.
Add public APIs required to implement [NSGarbageCollector -enable] and [NSGarbageCollector -disable].
15 years ago
theraven 9015795dde Use explicitly typed memory for instances. 15 years ago
theraven 2329b7a1ec Change spelling to be consistent with Apple. 15 years ago
theraven 929f8f95b4 Improved a few GC functions.
Added objc-auto.h header, providing (documented) public interfaces to this
functionality.
15 years ago