home *** CD-ROM | disk | FTP | other *** search
- HeapGraph version 1.00 01 Sep 1994
- ----------------------------------
-
-
-
- Introduction
- ------------
-
- This is a C library which uses my StubsHack library to provide a
- very simple way of making your program send information on every block
- of memory allocated/freed to a file in pipe:$.C_Debug. This is scanned
- by the included application !HeapDisp, which displays your program's
- heap graphically in real time, and also displays diagnostic text.
-
-
-
- Installation
- ------------
-
- You should move the HeapGraph directory into your C path. Don't move any
- headers into an existing .h. directory, as they are refered to as
- 'HeapGraph.<headername>.h' in the source.
-
- I find this to be a much simpler way of organising C libraries than
- changing C$Path etc. It also protects against problems when header files
- from different libraries have the same name.
-
- The actual library is 'HeapGraph.o.HGLib'.
-
- Please note that HeapGraph needs my 'StubsHack' library to work.
-
-
-
- To use in your own programs
- ---------------------------
-
- HeapGraph is dead easy to use. Just include "HeapGraph.HeapGraph.h" in
- the source-file which contains your main() function and then, at the
- start of main, put a 'HeapGraph_RedirectAllocFns( NULL);'.
-
- Link with HeapGraph.o.HGLib and StubsHack.o.SHLib (in that order, since
- HeapGraph refers to things in StubsHack).
-
- Compile/link your program, run the program !Displayer, and start your
- program. Your program's heap will be dynamically displayed in one of
- !Displayer's windows.
-
- If you do a '*Filer_OpenDir Pipe:$.C_Debug' from the command line, you
- will see the pipe file being created/emptied as the program runs.
-
- An example program is provided which uses HeapGraph - it runs a program
- in a TaskWindow which continuously allocates/frees memory. !Displayer
- will show the blocks of memory moving around. HeapGraph also works
- perfectly with Wimp programs - in fact it should work with anything that
- can write to the pipe filing system.
-
-
-
- !HeapDisp
- ---------
-
- This uses my Shell library and DeskLib, and is not particulaly polished.
- If you would like to improve it, it's made available under the GNU
- licence, so you must release the source with any released improved
- version.
-
- !HeapDisp will continuously scan Pipe:$.C_Debug.*. When it finds a file,
- it will open a separate window for it - !HeapDisp can display the heap
- of any number of programs at the same time.
-
- You can also send text to !HeapDisp which it will display along with the
- heap display - just use HeapGraph_Sendf( ...) in exactly the same way
- that you would use printf( ...).
-
- Pressing <Shift>-Menu will bring up a save box. If the click was over
- text, this text will be saved. If the click was over the picture of the
- heap, it will be saved as a sprite. This isn't particulaly useful, but
- Shell has the code in it aready, so there's no harm done or programming
- time wasted!
-
- Pressing Menu will bring up a menu with which you can set the vertical
- size of the heap display.
-
-
-
- Other
- -----
-
- All the contents of the HeapGraph directory are © Julian Smith, 1994.
- Feel free to distribute it, but only distribute the original version. If
- you make any changes, please send them to me and I'll send them out with
- the next release.
-
- Any suggestions/comments/bug fixes etc are very much welcomed.
-
-
-
- - Julian Smith
-
-
- ------------------------
- julians@cogsci.ed.ac.uk
- ------------------------
-
- or:
-
- ------------------------
- Department of Psychology
- University of Edinburgh
- 7 George Square
- Edinburgh
- EH8 9JZ
- UK
- ------------------------
-