Is Objective-C on Linux garbage collected?

2019-07-06 11:21发布

问题:

Objective-C v2.0 (which is what the mac uses) got a new feature, Garbage Collection. I'm a kid on a Linux PC (Ubuntu in case your wondering). So my question is, using the gcc/g++ compiler is Objective-C Garbage Collected?

回答1:

Replies above are wrong. Garbage collection has been a part of gcc's implementation of Objective-C since at least gcc 2.95. The most recent version is gcc 4.4.1.



回答2:

If you are refereing to Gnustep Objective-C. I think you have to build gnustep with gc enabled and linked to some gc library. But if you do apt-get install it comes built like that.