Skip to content
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

Closed
wants to merge 3 commits into from
Closed

Conversation

ospfranco
Copy link

No description provided.

@ospfranco ospfranco mentioned this pull request May 9, 2020
@oliverepper
Copy link

There’s no garbage collection in Swift. It will be removed from the heap because of the automatic reference counting.

@ospfranco
Copy link
Author

ospfranco commented May 18, 2020

@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?

@ospfranco
Copy link
Author

@oliverepper wikipedia seems to agree with me (check the reference counting part) https://en.wikipedia.org/wiki/Garbage_collection_(computer_science)

@oliverepper
Copy link

oliverepper commented May 18, 2020

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.

@ospfranco
Copy link
Author

ospfranco commented May 18, 2020

Screenshot 2020-05-18 at 10 15 12

it doesn't matter if it is done on compile time or on runtime, if you don't manually de-allocate memory it is garbage collection

@oliverepper
Copy link

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.

@ospfranco
Copy link
Author

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

@ospfranco ospfranco closed this Mar 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants