News for hackers. Stuff that matters.
Re:Garbage Collection is Wrong by letzjuc on Thursday February 27, 2014 @04:47PM (#7315366)
I fail to see why you need cycles' support for that.
Re:Garbage Collection is Wrong by mikeash on Thursday February 27, 2014 @04:52PM (#7315395)
You asked for a situation where the lifetime of a resource can't be directly tied to the lifetime of a single storage location. Cycles are a different matter.
Re:Garbage Collection is Wrong by letzjuc on Thursday February 27, 2014 @05:09PM (#7315540)
>You asked for a situation where the lifetime of a resource can't be directly tied to the lifetime of a single storage location.

I don't think I asked for that but correct me if I did (maybe I'm just not understanding your point).

Anyways, could you elaborate why shared_ptr, unique_ptr, and weak_ptr don't work in that case?

Re:Garbage Collection is Wrong by mikeash on Thursday February 27, 2014 @09:13PM (#7316843)
Oops, wasn't you, but the OP I was responding to initially.

shared_ptr works fine for my example. Shared immutable state is a case where reference counting works extremely well, since immutability implies no cycles.