SSJX.CO.UK
Content

Converting Iff2Bmp to D

This is a summary of porting the Amiga IFF ILBM converter to the D Programming Language.

This program went through several different languages, each had different strengths and weaknesses:

I was happy with the Pascal version but thought porting it to D would be interesting. The D version may be a little quicker (not checked), is fairly memory safe and there were more modern programming techniques/methods that could be applied.

This guide does not repeat the items mentioned in the previous Converting Avi2Cvc from C to D guide.

Simple Stuff

In no particular order:

Garbage Collection

I mentioned the GC profiling before but it is worth mentioning again! To get a GC profile log, compile with -profile=gc and when you run the program you get an easy to read profilegc.log file.

Running the profile enabled version gave this:

bytes allocated, allocations, type, function, file:line
          65536	              1	ubyte[] D main iff2bmp.d:437
          65536	              1	ubyte[] D main iff2bmp.d:523
          32768	              1	ubyte[] D main iff2bmp.d:409
            128	              1	ubyte[] D main iff2bmp.d:391
             16	              1	immutable(char)[] D main iff2bmp.d:528
             16	              1	ubyte[] D main iff2bmp.d:420

All good and as expected. The 'immutable(char)' is the output file name, the others allocations are data chunks and buffers.

Last Updated 20/05/2024
Created 15/02/2020