naga@wet.UUCP (Peter Davidson) (04/09/91)
MS-DOS programmers who have had problems with far memory allocation, including allocation of multi-dimensional arrays, will no doubt be interested to hear of a new C function library which addresses these difficulties, the Far Memory Manager & Diagnostic C Library. This is, in part, a far memory debugging package. It is a replacement for the far memory functions in the Microsoft C and Turbo C/C++ libraries, and is an extension to them, providing numerous additional far memory functions. The library provides a debugging tool in the form of a memory allocation log, in which details of memory operations can be recorded as they occur. Two reports, based on this log can be output to screen, printer or disk file. The items may be output either in chronological order or grouped into operations on the same block (thus providing an individual block history). During the development of a program which uses far memory a flag may be set that will cause the program to terminate when any of the functions in the library detects a critical memory error (that is, damage to the memory control blocks). Any of the available reports can be output automatically upon termination, thus providing a history of far memory operations up to the point at which the error was detected. A far heap dump function may be called to give a map of memory blocks allocated in the far heap by the currently executing process. A useful hexdump function is thrown in as well. Multi-dimensional array allocation functions are provided (arrays of up to five dimensions are supported) along with functions to free those arrays. This makes it easy to allocate memory for arrays (of any type of data object) in far memory. These arrays may be as large as available memory permits. Array operations are also recorded in the log, together with the constituent memory block allocations that make up a multi-dimensional array allocation. The library is supplied in two versions, one for Microsoft C (Versions 5.10 or 6.00) and one for Turbo C (Version 2.00) and Turbo C++ (Version 1.00), and in small, medium and large models. There is a single header file required. Source code is given for a dozen compilable demonstra- tion programs, illustrating the use of the functions. There is a printed manual fully explaining the demo programs as well as the functions themselves. For more information and a demo disk send a usnail address to cca.ucsf.edu!wet!naga.