26 Commits (cd50e72f81628fb2a76da54a5ddfa98bf5ced6ab)

Author SHA1 Message Date
Frederik Seiffert 5308d21c1e Use const pointers for associated object keys.
Matches Apple platform implementations.
7 years ago
David Chisnall bd5637af6d Fix memory leak in @synchronized.
This was actually a memory leak in the hidden class implementation, but
it was mostly visible in the @synchronized implementation.  Every hidden
class registered a custom .cxx_destruct method, to handle cleanup of all
of the hidden class structures.  Unfortunately, this destructor failed
to delete the reflection metadata structures associated with the class,
specifically the objc_method_list containing the objc_method pointing to
the destructor itself.

Fixes #98
7 years ago
David Chisnall d015f0160c Rename PUBLIC to OBJC_PUBLIC to avoid some namespace pollution. 7 years ago
David Chisnall 934cd13a7a Initial pass at Windows support.
All tests now pass with the new ABI on x86-64, with the new ABI.  Some
of the code is ugly and other platforms are probably broken.
8 years ago
David Chisnall 22abbd2ca2 Fix a bug in hidden class deletion.
We were leaving the isa pointer pointing to the deleted class and were
then following its super_class pointer, both of which are potentially
serious.  This didn't show up on FreeBSD, because the relevant memory
was always returned to a thread-local pool and the accesses were
immediately afterwards, so it always worked.  It broke with malloc
implementations that were more aggressive about checking for
use-after-free.
8 years ago
David Chisnall b81df02b91 Merge branch 'master' into newabi
Simplify the setSubclass dtable updating mechanism.
8 years ago
David Chisnall 4036a88936 Remove separate flags for class and metaclass.
Every class is either a class or a metaclass, it doesn't make sense to
use two flags to store one bit of data.

Also remove the newabi flag from classes in the v2 ABI, where it's
redundant.
8 years ago
Dustin Howett 828e6ebf70 always look beyond the first page of associated objects
Without this fix, we would lose associated objects silently after adding
the 11th. We would also allocate full pages for each object after the
11th because we couldn't find empty slots.
8 years ago
Dustin L. Howett e3b069cedc Use the old association policy to determine whether to release an object
This commit has been augmented to address the comments in
https://github.com/Microsoft/libobjc2/commit/df7f9061670cce994730d1720150adc
8 years ago
David Chisnall a2a80ac5dc Remove debugging printf. 8 years ago
David Chisnall d6ca506d6a Make sure that we remove hidden classes from the subclass list, as well as adding them. Also make sure that subclass list manipulation is protected by the runtime lock. 11 years ago
theraven d838f7ad28 Don't crash when trying to synchronize on nil (but don't do anything sensible either). 13 years ago
theraven 38568fca57 Remove some dead code. Fix a bug when cloning objects with no associated references. 15 years ago
theraven 5d3c047fa2 Finished implementing JavaScript-style prototypes. 15 years ago
theraven b54719abf1 Basic support for prototype-style object orientation (you can now add methods to an individual object). 15 years ago
theraven 8af52846b7 Small object (hidden in a pointer) support. 15 years ago
theraven 663995f08c Small cleanup. Use the ARC functions for retain / release / autorelease messages everywhere. This will make properties faster if we're using an ARC-compatible NSObject. 15 years ago
theraven e05c9c2ff5 More GC fixes 15 years ago
theraven a4decfa4e3 Add hidden class -dealloc method as -finalize as well. 15 years ago
theraven 9015795dde Use explicitly typed memory for instances. 15 years ago
theraven 9dcc66f7f6 Make sure that associated objects and blocks use GC-scanned memory in GC mode.
Blocks do not yet support __weak bound variables.  This needs fixing before the release.
15 years ago
theraven 52381f163b Make sure locks are initialised before using them and destroyed afterwards. 15 years ago
theraven 7b49755964 Dtable cleanup cleanups. 15 years ago
theraven d7056f6de2 Simplify @synchronize() and improve efficiency (space and time). 15 years ago
theraven 987ab88a94 Don't do hidden-class transforms for classes, just dangle the look-aside data off the class structure.
Individually lock classes so that +initialize can be sent concurrently to two different classes in two different threads.
15 years ago
theraven e198597bd3 Added support for associative references. Modified sync code to use this. 15 years ago