Objective-C Runtime
A downloadable tool for Windows
This is an enhanced Objective-C runtime with features for easy life-cycle management of resources and object destruction. It should compile and work with the lates TDM-GCC and some good editor for C. (DevCpp or Clion seem to work best). Just make sure to install the actual Objective-C compiler package when asked.
When compiling Objective-C code the compiler will replace these new language constructs with the respective calls to the runtime. My implementation is a small bit of C++ code that provides the necessary features for classes, methods, and inheritance as well as initialization for static language constructs like string-literals.
Each call to an Objective-C method is wrapped by the auto-release manager. Objects can register with this manager and it will call their respective "release" method when the method-call has returned.
This implementation also features a simple allocator that adds reference counting to memory-blocks. Objects created from these blocks will use a pseudo-class to differ an allocated instance from some static construct. This pseudo-class behaves exactly like the original class.
I also implemented a few classes for creating a basic Direct2D window application in order show off some running code. During development I found that object destruction via auto-release can be used for pretty much all kind of cleanup / finalization code. Very similar to a C++ destructor.
I've decided to replace the traditional alloc-init idiom with a pattern of class-methods that just create an initialized object. This simplified error-handling because they can just return NULL and auto-release will just cleanup all the resources that may have already been created.
Status | Prototype |
Category | Tool |
Platforms | Windows |
Author | DerEchteZweig |
Download
This tool is currently unavailable
Leave a comment
Log in with itch.io to leave a comment.