FROM : Michael Ash
DATE : Wed Apr 16 18:26:20 2008
On Wed, Apr 16, 2008 at 12:04 PM, Clark Cox <<email_removed>> wrote:
> The purpose of the write barrier is to tell the collector to keep
> something alive; it has nothing to do with when to collect it.
Right, I get that now.
[snip]
> Garbage Collection:
> The housekeeping is taken care of, I don't have to worry about it.
> However, I cannot know exactly when my object will be destroyed (it
> might be right away, it might be in a couple of seconds).
I don't see the relevance of this. The Cocoa GC explicitly only works
properly if you play by the rules it sets out. For example, if you
store a pointer in unscanned memory then you're playing with fire and
the object may well have been destroyed by the next time you try to
use it. Skipping write barriers likewise. I had thought that using
write barriers for clearing memory was part of the required rules, but
now it appears that it is not. But regardless, Cocoa GC only takes
care of its housekeeping when you take care of yours.
Mike
DATE : Wed Apr 16 18:26:20 2008
On Wed, Apr 16, 2008 at 12:04 PM, Clark Cox <<email_removed>> wrote:
> The purpose of the write barrier is to tell the collector to keep
> something alive; it has nothing to do with when to collect it.
Right, I get that now.
[snip]
> Garbage Collection:
> The housekeeping is taken care of, I don't have to worry about it.
> However, I cannot know exactly when my object will be destroyed (it
> might be right away, it might be in a couple of seconds).
I don't see the relevance of this. The Cocoa GC explicitly only works
properly if you play by the rules it sets out. For example, if you
store a pointer in unscanned memory then you're playing with fire and
the object may well have been destroyed by the next time you try to
use it. Skipping write barriers likewise. I had thought that using
write barriers for clearing memory was part of the required rules, but
now it appears that it is not. But regardless, Cocoa GC only takes
care of its housekeeping when you take care of yours.
Mike
| Related mails | Author | Date |
|---|---|---|
| Brendan Younger | Apr 15, 07:42 | |
| Alastair Houghton | Apr 15, 16:18 | |
| Greg Parker | Apr 15, 22:53 | |
| Michael Ash | Apr 16, 04:29 | |
| Alastair Houghton | Apr 16, 11:28 | |
| Clark Cox | Apr 16, 18:04 | |
| Michael Ash | Apr 16, 18:22 | |
| Michael Ash | Apr 16, 18:26 | |
| Clark Cox | Apr 16, 19:48 | |
| Alastair Houghton | Apr 17, 12:43 |






Cocoa mail archive

