[net.micro.pc] IBM Pascal Runtimes

Nikhil.UPenn%Rand-Relay@sri-unix.UUCP (02/08/84)

From:  Rishiyur Nikhil <Nikhil.UPenn@Rand-Relay>

 IBM Pascal Runtimes
 ___________________

 We are trying to install an existing program written in Pascal on an
 IBM PC with 512kb of memory, using IBM Pascal. The program is large
 (a couple of thousand lines), in several modules, and works fine under
 TOPS-10 on a DEC-10.

 We use the heap via the NEW(..) statement. We do not use the DISPOSE
 statement; instead, we reclaim used records in our own linked list,
 because many Pascals (IBM Pascal excluded) do not implement DISPOSE.

 All our dynamic storage usage is strictly standard Pascal (we do not
 diddle with bit representations, addresses or anything), but we have been
 repeatedly and erratically thrown out with a "Heap is invalid" error
 message. (Note: this is NOT the same as being out of memory when the
 stack meets the heap.)

 We are at our wits end trying to figure out why this happens. Has anyone
 else had this problem, and do you have any suggestions to offer? I would
 would be very grateful for any help on this matter. Please reply to

                       nikhil.upenn@csnet-relay

 if any points of general interest arise, I will summarize them for the net.

 Other IBM Pascal problems that I would be delighted to be enlightened upon:

 - Is there any way to get a traceback when a Pascal program bombs?
   All I can get it to do is to give me the procedure/line where it
   crashed, but I would sure like to know the call-stack at that point.

 - It appears to me that the heap allocation routine will make a complete
   circuit of the heap looking for a free block before deciding to expand
   it. This means that if all your program does is to allocate a linked
   list of length N, it will take N-squared time. This is ridiculous!
   Or am I mistaken in my understanding of the heap allocation routine?

 - Is there any good reason why the implementors of this Pascal chose to
   use the heap to maintain the source error context instead of using the
   regular stack? If the heap allocation routines are flaky by themselves,
   this could only make matters much worse!

 As you might guess, the more I learn about IBM Pascal, the more
 distasteful it gets! I would love to have my mind changed by someone who
 knows the innards of this beast.

 Nikhil

[The editors suggested a copy of Microsoft Pascal would be more up to date
than the IBM version. I don't know if this will fix these specific problems,
but at least one can then complain directly to Microsoft with perhaps more
effect than complaints to IBM. -ed]