-
Notifications
You must be signed in to change notification settings - Fork 81
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
Update Readme to mention HotKey instance must not be de-allocated #27
Conversation
There’s no garbage collection in Swift. It will be removed from the heap because of the automatic reference counting. |
@oliverepper Garbage collection is just a generic term to any mechanism that automatically de-allocates items from memory, reference counting (AFAIK) is just one of the many ways to achieve this, so in fact Swift IS garbage collected, am I wrong? |
@oliverepper wikipedia seems to agree with me (check the reference counting part) https://en.wikipedia.org/wiki/Garbage_collection_(computer_science) |
Yes. You might be right. Haven't thought about it that way. My guess is that you're right and GC is in fact a generic term. I see it used for something opposed to ARC often, though. Maybe some compiler/language-guy can jump in here? P.S.: Even the Wikipedia article you linked states the difference between GC and ARC in the Objective-C section. P.P.S.: After further reading I guess there's a distinction to be made between GC (which happens at runtime, extra thread) and ARC (which happens with the help of the compiler, inserts release-statements). So I guess you cannot say that Swift is a garbage-collected language. |
Would be nice if you linked to that instead of a screenshot. Can you do that? I think there's a distinction to be made between what is generally perceived as GC (even if technically wrong) and ARC where the programmer is involved in memory management at least with preventing retain cycles. In the context of your pull-request I don't think that this discussion is even necessary. |
Alright, I can see that I'm going against the marketing here, I'm sure a computer scientist would agree that ARC is just another way of GC, in any case, I will modify the wording a bit to please the gods |
No description provided.