theraven
535ba87a8e
Store the selector, not the type encoding, in slots.
15 years ago
theraven
7b49755964
Dtable cleanup cleanups.
15 years ago
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.
15 years ago
theraven
4ee1b1f4ac
Test first, then commit...
15 years ago
theraven
faa741b133
Added some header documentation for runtime functions.
15 years ago
theraven
7336df75bc
Added some more comments, C++ include guards around runtime.h.
15 years ago
theraven
28e6960441
Make object_getIndexedIvars() more robust against compiler bugs.
15 years ago
theraven
94e5f7b344
Return "nil" instead of nil from class_getName with a nil argument. This is stupid (what happens if you have a class called nil?) but it is what OS X does.
15 years ago
theraven
4a3326f2fd
Fix class_getMethodImplementation() semantics for Apple compatibility (returns forwarding selector IMP, doesn't actually do the forwarding).
15 years ago
theraven
91e9758fda
Add lots of checks for NULL-pointer arguments to runtime functions.
15 years ago
ericwa
a7ea477400
libobjc2: put libobjc compatibility functions in runtime.h marked __attribute__((deprecated))
15 years ago
qmathe
9dbf872f33
Fixed crash when resolving user-allocated classes (e.g. KVO) revealed by r31482.
...
objc_resolve_class() does ((Class)objc_getClass((char*)cls->isa->isa))->isa;
but cls->isa->isa was a metaclass object and not a C string if the class was
user-created. objc_allocateClassPair() has been changed to set the
meta-metaclass as a C string and not an object, so that objc_getClass() does
not return Nil.
15 years ago
theraven
76bb7762ff
Properly resolve the metaclass's isa pointer.
15 years ago
theraven
7be9f34619
Fixed @synchronize() with a class that has had an instance used for @synchronize().
15 years ago
ericwa
d56930241e
Stylistic fixes
16 years ago
ericwa
ed1c9d41eb
libobjc2: Add a pile of NULL checks. In general, any public function should be able to handle NULL for any object/class/selector/pointer to opaque structure without blowing up.
16 years ago
theraven
84fd691944
Make adding more than one ivar with class_addIvar() work...
16 years ago
theraven
e1562b28d4
Correctly calculate the offset when adding ivars.
16 years ago
theraven
108247eb5d
Fix dead store (the only bug found by the clang static analyser).
16 years ago
theraven
fe566cbc2f
Fix introspection with type-dependent dispatch enabled. Looking up a method with an untyped selector was failing because the UID for the selector was no longer the same for all type variants.
...
As a side-effect of this change, method lookups for introspection are now much faster. They use the slot lookup mechanism to find which class has the method declared and then only need to do the linear search on that class, rather than doing the linear search on the entire hierarchy (slow!). If the method is not present, then they can give up after two memory accesses, rather than after searching a few hundred list entries, but that's a less important case.
I also noticed while tracking down this bug that the implementation of methodSignatureForSelector in GNUstep is very inefficient. I'll tweak that next.
16 years ago
theraven
779b28abeb
Lots of tidying, removing legacy stuff.
16 years ago
theraven
4ee07676cc
Added rewritten encoding parser. The functions that function pointers as arguments and parse compound types should be exposed via the public interfaces, or possibly moved to a separate library - they are generally useful.
16 years ago
theraven
b1b9baf382
Finished rewrite of message sending. Deleted lots of legacy stuff.
16 years ago
theraven
de71ebb6b1
Rewritten class loading.
16 years ago
theraven
7f6f798074
Rewrote some of the class table code to be slightly cleaner.
16 years ago
theraven
a692cbd4dd
Fix some GCC warnings. Patch by TOM.
16 years ago
theraven
b04cccf46b
Fixed some issues in runtime.c when looking up methods. This fixes some issues with DO.
...
Removed GNU dtable and sparse array implementations, replaced entirely now with versions based on the Étoilé runtime. Performance is roughly equivalent in microbenchmarks, memory usage is significantly lower (Gorm goes from 95MB to 50MB on my machine - this will be even more pronounced on 64-bit systems), which should improve cache usage considerably. Still room for some performance tuning, however.
16 years ago
theraven
2d84b96a72
Tidied up some bits by creating private headers for private data structures.
...
Imported selector table code frm the Étoilé runtime. We can now make dispatch type dependent with a -D switch. Not enabled yet, but it will be enabled in a warning mode soon - I consider preferable to the existing GNU and Apple solution of corrupting the stack.
16 years ago
theraven
d9ead92cb3
Fixed bug in allocating metaclasses for lock classes.
16 years ago
theraven
023184f4b5
Removed unused static function.
16 years ago
theraven
ff7af18060
Correctly handle getting the name of nil. For some given value of correct, where 'correct' means 'compatible with the Apple behaviour' and not 'actually sensible'.
16 years ago
theraven
a35ece500f
Rewrote objc_getClassList() to use class table directly.
...
Fixed missing UNLOCK() from last commit.
16 years ago
theraven
0abdc2a574
Small cleanups from last commit.
16 years ago
rfm
5eb97d0e38
fix missing line
16 years ago
rfm
76845ff81c
fix wrong commit
16 years ago
rfm
b7963e23a6
backport class data copying fixes from ObjectiveC2
16 years ago
rfm
e2f4f38e45
backport bugfixes from ObjectiveC2 code
16 years ago
rfm
bf92e25952
match ivar lookup with osx and compatibility library
16 years ago
rfm
607bc433c9
Fix instance variable lookup to match OSX
16 years ago
theraven
719b540317
Set resolve / initialize flags for new metaclasses.
16 years ago
theraven
ae11414b4d
Handle case where @synchronized is used with a class.
16 years ago
theraven
d4fe4f522e
Fixed typo in comment in runtime.c.
...
Fixed unsafe dtable access in message lookup.
16 years ago
rfm
0e7441570b
fixup bad function prototype
16 years ago
rfm
fb97e23e50
fix class_respondsToSelector()
16 years ago
theraven
8058495e39
Fix crash with gcc-compiled protocols.
16 years ago
theraven
a2dbc582de
Made objc_getProtocol() return a protocol from the protocol table, rather than creating a new one.
16 years ago
qmathe
e92f753091
Restored objc_getProtocol() which seems to have been accidentally removed.
...
Fixed class_replaceMethod() to update the dispatch table.
16 years ago
theraven
4a9187b1cc
Made allocateClassPair() set the name of the metaclass.
16 years ago
theraven
9f602c083c
Fixed class_getInstanceSize();
16 years ago
theraven
bd8626e692
Fix warning in last commit.
16 years ago