How to use D without the GC ?

bachmeier no at spam.net
Wed Jun 12 15:21:22 UTC 2024


On Tuesday, 11 June 2024 at 17:15:07 UTC, Vinod K Chandran wrote:

> Hi Steve,
> Two reasons.
> 1. I am writting a dll to use in Python. So I am assuming that 
> manual memory management is better for this project. It will 
> give finer control to me.
> 2. To squeeze out the last bit of performance from D.

On the second point, I would be interested in hearing what you 
find out. In general, I have not had any luck with speeding 
things up inside loops using manual memory management. The only 
that's worked is avoiding allocations and reusing already 
allocated memory.

You're splitting things into GC-allocated memory and manually 
managed memory. There's also SafeRefCounted, which handles the 
malloc and free for you.


More information about the Digitalmars-d-learn mailing list