|
Fortunately, some years ago, I did develop a bit of code on my own. I wrote a text based windowing package that ran on DOS systems. (Don't laugh!) I was just playing around with it, but (of course) it's useless now. At the time I also wrote a set of memory allocation wrappers that allowed me to find any memory leaks and figure out what I hadn't free'd in the C I was writing. Those memory allocation wrappers aren't useless -- though Purify is much better -- and I've kept them around.
They went through a few incarnations as I donated copies of them to employers at various points. Spectra Physics got a copy in their LABNET bus monitor program. Amdahl got a copy (ported to UTS -- their UNIX variant) in some CM tools I wrote. Chordiant got a copy (ported to Windows-NT) in a tool I wrote to manipulate the Windows registry.
Here I present the code for UNIX -- my favorite OS to date. I don't claim this will end world hunger, or provide infinite cheap energy for developing countries. It was written quickly, and so it has some limitations that I would eliminate if I were dealing with larger applications. Perhaps one of these days I'll get to the to-do list that lives in allocmem.c, but I don't see that happening any time soon.
Here it is:
One note: If you snatch a copy of this code and want to compile it, you'll need to replace '<' with '<', '>' with '>', and '&' with '&'. That's just something I had to hack to make the foo.c and allocmem.c look right in the browser. Of course, you'll need to remove the HTML tags before and after the code in all the files anyway, so this shouldn't be a big surprise.
Implicit in the previous paragraph is that you are welcome to snatch a copy of this code. Just remember there is no warranty of any kind supplied with it.
As always, if you have any questions about this stuff, use the "Contact" button up above.