December 1, 1992 The submission in this directory contains C support routines to allow DIBOL programs to use Dynamic memory in addition to Static memory. The problem: since DIBOL pre-allocates space for static arrays, program disk image sizes that use large arrays can become quite large (>1000 blocks). The dynamic memory routine allows the programmer to allocate arrays at runtime, thus saving considerable disk space. Two programs are included as examples: PROG1.DBL, which is a standard DIBOL program which uses arrays. PROG2.DBL is a rewrite of PROG1 using the dynamic memory routines. There are two main caveats to using these routines: One, the program needs to be linked allowing modification of the data descriptors (memory structures). It is possible for the programmer to overwrite this area, which would have crashed the program before with an access violation, but will now cause some difficult-to-detect memory corruptions, although this event is unlikely to occur unless other C or System subroutines are used. Two, if a field is declared using dynamic memory routines, the programmer must remember that clearing the record (or group) containing the data field will NOT clear the dynamic array. Due to the way DIBOL defines data fields, clearing the record will clear the memory area declared at compile time. Manifest: AAAREADME.TXT This description file BUILD.COM A command file to build the example programs BUILD.OPT A linker options file to build the example programs DYNMEM.C Subroutine to allocate/deallocate dynamic memory DYNMEM.OBJ Compiled version of DYNMEM.C PROG1.DBL Standard DIBOL example PROG1.EXE Pre-built PROG1 executable PROG2.DBL Standard DIBOL example modified to use DYNMEM PROG2.EXE Pre-built PROG2 executable VALUE.C Subroutine to get value of a number passed by descriptor VALUE.OBJ Compiled version of VALUE.C -------------------------------------------------------------------------------- David Hittner Internet: hittner@pui.com Projects Unlimited, Inc. UUCP: udcps3!probiz!hittner 3680 Wyse Rd, Dayton, OH 45414-5802 Tel/Fax: 513.890.1918 / 513.890.4911 -------------------------------------------------------------------------------- "Reality is frequently inaccurate." - Hitchhiker's Guide to the Galaxy