Writing your own runtime, runtime hooks, etc.

GrimMaple grimmaple95 at gmail.com
Thu Dec 12 06:52:27 UTC 2024


On Wednesday, 11 December 2024 at 18:16:24 UTC, solidstate1991 
wrote:
> I'm thinking about writing, or well, rather modifying the 
> existing default runtime of D, mainly by stripping out the GC 
> and moving memory management to a primarily manual one. Option 
> for refcounting etc. will be added (especially as it exists in 
> Phobos, I just need to modify it), reworking D arrays for 
> manual management will be a wild ride though.
>
> I will try to catalogue the runtime hooks too during my 
> process, however I don't really see any info about how to use a 
> custom made runtime. Is it enough to just use betterC, then 
> include the newly created runtime as a dependency? Do I need to 
> mess with compiler configurations?

All you need to do is have an `object.d` file in your build, 
that's where the runtime is, effectively. If you have a 
non-standard `object.d` supplied, the druntime is ignored and 
your custom runtime is used. `betterC` disables any runtime in 
general, so that's not what you want.


More information about the Digitalmars-d-learn mailing list