[comp.lang.pascal] TeX, Pascal/VS, dynamic memory allocation, and so forth

U12921@uicvm.uic.edu (Don Hosek) (07/27/89)

I am currently attempting to find a convenient way to shoe-horn some
large memory TeX into a low memory environment under VM with Pascal/VS.

First some background:
TeX is a large program. Compiled it takes roughly 268K of disk space. The
main memory array, to be useful should contain (at least(!)) 64K words
of memory. Now if a word is defined to be 4bytes, this works out
alright, and TeX runs fine in 2M. However, because of TeX's architecture,
the memory must be indexible using a halfword (note that words, halfwords,
and quarterwords need not have any relation to the hardware-defined
equivalents), so with the 4byte word memory array, the maximum size is
64K words.

"Big TeX" is TeX defined with a word size greater than 32bits (typically
64bits, but not always). Thus a halfword now can take a range such as
-(2**31)..2**31-1 and memory limitations are a thing of the past. However,
because a word is twice as big, it (of course) takes twice as much space
(maybe more, from what I've seen)--a 30000 word main memory array runs
out of space in 2M of VM. Increasing the VM size takes care of that
problem, but it would be nice to have a reasonably endowed TeX which
can run under 2M.

So now come the problems... how can I conserve space in Pascal/VS to allow
more bang for the buck? Are there any tricks I can use to cut down the
amount of memory used by the compiled Pascal program. My calculations
show that an 8byte word size in a 64K word array should fit into 512K;
add in other variables and the main progarm, and in theory I should be
able to squeeze into 1M of usable space. So why isn't it working? Any
suggestions for insuring that as much memory as possible is made available
to the program before it is run?

Please send copies of responses directly to me (as well as to the list if
you think it might be of general interest) as I am not on some of the lists
to which this note is being posted.

Thanks
-dh

    -------------------+-----------------------------------------------
    Don Hosek          | Internet: U12921@UICVM.UIC.EDU
    3916 Elmwood       | Bitnet: DHOSEK@HMCVAX.BITNET
    Stickney, IL 60402 |         DHOSEK@YMIR.BITNET
    Work: 312-996-2981 | UUNet: dhosek@ymir.claremont.edu
    ERASE * SCRIPT *   | JANET: DHOSEK%HMCVAX.BITNET@UK.AC.EARN-RELAY
    -------------------+-----------------------------------------------
                     24 days until my return to California