3 ms·
> (aside from objc_msgSend) you can implement the whole thing in C And if you're willing to impose some limitations (maximum number of arguments, no floating-p
by duskwuff 9y ago
> (aside from objc_msgSend) you can implement the whole thing in C
And if you're willing to impose some limitations (maximum number of arguments, no floating-point arguments or return value), it's quite easy to implement a "toy" version of objc_msgSend in pure C.
- favorited 9y agoI remembered after writing this that there's an implementation[0] that boxes up method arguments, giving everything a signature of `void objc_msgSend(void self, SEL _cmd, void *_param)`. [0]https://www.mulle-kybernetik.com/weblog/2015/mulle_objc_meta_call_convention.html https://www.mulle-kybernetik.com/weblog/2015/mulle_objc_meta...