Does TC's farrealloc have a bug?

Matthew Smith msmith%peruvian.utah.edu at cs.utah.edu
Sat Jun 22 04:47:38 AEST 1991


In article <1991Jun21.152700.25820 at doc.ic.ac.uk> pj at doc.ic.ac.uk (Paul Jarvis) writes:
>
>I have recently had a report of problems using huge far pointers and allocating
>and freeing memory. The problem appeared to be that the free process did not
>work hence memory got lost. The compiler was Turbo C (sorry version not known).
>Changing to Borland C++ compiler with identical code - i.e. the same program
>no problem. My conclusion is that there may be some problems with allocating
>large memory chuncks but I sure don't want to try to prove it.
>                           Paul
>                        (pj at doc.ic.ac.uk)

Do a farcoreleft() call before doing your farmalloc(), then do another
farcoreleft(), then call farfree() and do a farcoreleft().  Watch how your
values go.  The final farcoreleft() number should match the first farcoreleft()
number.

Matt Smith
msmith at peruvian.utah.edu
University of Utah
Department of Computer Science



More information about the Comp.lang.c mailing list