-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Any pointers on an ARC design? #7
Comments
There may be papers out there that explain this technique, but I'm not aware of any of them. Its just something I thought of and started implementing. I like calling it Automatic Reference Journalling cos it does more than just counting references. The problem with the method now is that it does deep analysis of each object which might hurt compile time, but then I've not spent enough time with it to optimize it. |
I'm closing this issue. I believe I've provided answer to the question asked. |
Hi, I have another question about ARC implementation. How you resolve cyclic references which cause to memory leak without special hints? For example Objective-C/Swift use special week references define like: @property (nonatomic, weak) NSObject* a; Rust provide much wider patterns to resolve this like RefCell, Weak, and Rc. Some languages like Alef/Limbo has ARC with fallback to GC for resolving this case. So which way will you choose? |
Sorry, I got this late. The ARC method I'm employing is not like Objective-C/Swift, nor like Alef/Limbo ARC-tracing hybrid. • Detlefs, D. (2004). Automatic Inference of Reference-Count Invariants. But none of them goes into details of how this can be extended to concurrent programs, which is the same caveat mine has. For non-concurrent programs, objects can be freed deterministically without any runtime cost apart from calling free. In concurrent programs, the system falls apart since an async function may free an object in use by another async function after it exits. The exit order of invoked async functions can be unpredictable, so some sort of runtime synchronization is needed to handle that. You may need to take a look at the first paper I linked, it describes my method well. |
Is the mechanism based on some paper ? If so could you please share the details ?
Thanks
The text was updated successfully, but these errors were encountered: