|
|
|
|
|
by Someone
688 days ago
|
|
> How come the CoW method requires runtime reference counting? Because it doesn’t do copy-on-read, you have to know whether there are references other than yours that can read the data. A single bit “at some time there were at least two references to it” doesn’t suffice, as it would mean you can’t detect when the last reference goes away, so it would leak memory (lots of it) > A lot of the same benefit (but not all) should be available based on static analysis right? That’s an (very important) implementation detail that makes reference counting perform reasonably well. You don’t want increase-decrease cycles in tight loops, for example. |
|