Does TC's farrealloc have a bug?

Frank van der Hulst frank at cavebbs.gen.nz
Sun Jun 23 11:46:57 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).

One bug I've managed to prove relates to (at least) TC v2.01 and huge pointers.

If you have an array of structures which is more than 64K, then the pointer
arithmetic will be wrong for the array element (structure) which overlap
the 64K boundary.

This may cause subsequent problems with farfree(), farrealloc(), and (I guess)
anything else using the far heap.

Frank.

-- 

Take a walk on the wild side, and I don't mean the Milford Track.
Kayaking: The art of appearing to want to go where your boat is taking you.



More information about the Comp.lang.c mailing list