btdu - a sampling disk usage profiler for btrfs (written in D)

IGotD- nise at nise.com
Fri Nov 27 11:31:48 UTC 2020


On Friday, 27 November 2020 at 10:41:54 UTC, Ola Fosheim Grostad 
wrote:
>
> I think it is no different than shared_ptr. I also think one 
> can add some safety through global pointer analysis for 
> existing code.  Let the pinning be done by a counter, when you 
> pin the object you get a smartpointer borrowed_ptr... when the 
> count goes to zero, the object is local again.

Reference counting which also means multiple ownership doesn't 
play well well with any borrowing mechanism. Reason is that the 
compiler cannot determine the borrow checker at compile time and 
must insert runtime checks if you are allowed to borrow or not. 
This reduces the performance, probably not a lot but still. Let's 
leave borrow checker outside D and just have good old reference 
counting, that's what we need.

Speaking of parallel GC, even if we have atomic reference 
counting or other parallel method, the underlying malloc/free 
must also be non blocking or at least reduce the locking as much 
as possible. Many libc implementations have this already though.


More information about the Digitalmars-d mailing list