Thirty years ago, in February of 1987, I published some code of mine on net.sources:
There is so much deliciousness in this old post, including evidence that my affinity for the word “actually” goes a long way back.
Because I was a hardcore Amiga nerd back then (as opposed to simply now being an all-around hardcore nerd), I also submitted the program for inclusion in the “Fred Fish Amiga Source Disks” that he (Fred Fish) used to curate. It was included on disk #66 and still available as “MallocTest” online here:
For reasons surpassing understanding, I decided to download that code, unpack the archive (that itself took some research), and see if it still compiles and works.
Well, almost. It generated over 40 warnings on my Mac, mostly related to modern declarations of C library functions vs the mismatched (if even present at all) declarations in the code.
It did generate one fatal error – one of my functions does not return a value but is not declared void. I’m pretty sure that’s because the “void” type wasn’t universal back then, and in any case it was common practice to just fall out the bottom of what were implicitly void functions (that had been implicitly declared as “int”).
So, I had to fix that to get it to compile; here’s the diff that made the thirty-year old compile:
29a30,33 > void add_to_events (struct memevent *); 234c238 < add_to_events (m) --- > void add_to_events (m)
With that change, it still compiles and works! The code itself is a time capsule of everything that was wrong with software development back in the late 80’s, including most importantly the fact that the malloc/free library on a given machine might have a bug in it that this feeble test could uncover (which, apparently, it did, though I have since forgotten which platform I was researching malloc/free problems on at the time).
Presented, for your amusement: https://github.com/outofmbufs/MallocTest1987