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
theraven
752b7ec9d8
Another fix for allocating runtime classes.
16 years ago
theraven
da9aafd3ed
More fixes for bugs found by Mizuki.
16 years ago
theraven
2a5ba9f18a
Fixed class_get_super_class() so that it actually works and simplified class_getSuperclass() to call it directly. This fixes numerous other corner cases, for example you can now throw a constant string as an exception and have it work correctly even if no constant string objects have been sent messages.
...
Hopefully this will fix a few other Heisenbugs and reduce the strength of the Mottola Effect.
16 years ago
theraven
51ab4a935a
Fixed class_getSuperclass() implementation.
16 years ago
theraven
604efa7077
Add new classes to the class table when they are registered.
16 years ago
theraven
81de407358
Fixed method_getNumberOfArguments(), report by Mizuki.
16 years ago
theraven
028a312ecd
Fixed bugs found by Mizuki.
16 years ago
qmathe
8b9c723905
Added object_setClass
16 years ago
theraven
4771cd4e43
Added selector lookup functions. Implementations by Eric Wasylishen.
16 years ago
theraven
323e3dfaeb
Added new runtime library, based on GCC 4.4 libobjc, libobjc_tr and Objective2.framework.
17 years ago