Article View: gnu.utils.bug
Article #857Re: MS-DOS Version of diff Exhausts Memory
From: Simon J. Gerraty
Date: Tue, 15 Sep 1992 10:24
Date: Tue, 15 Sep 1992 10:24
32 lines
2176 bytes
2176 bytes
In <1992Sep3.155835.10175@midway.uchicago.edu> pynq@midway.uchicago.edu (George Jetson) writes:
>In article <87kn3yb.westes@netcom.com> westes@netcom.com (Will Estes) writes:
>>Using the MS-DOS version of diff 1.15, I occasionally get an error
>>message reporting that memory has been exhausted (this on a machine that
>>has 15 megs of extended memory). Do other users of the
>>MS-DOS version get the same error? Can someone point me to an ftp site
>This tells us nothing about which specific version of diff you are using.
>Who is it from? Who compiled it? Which compiler? etc.
I'd guess GNU diff-1.15 and he compiled it himself.
Anyway, I noted a similar problem when I was forced to port GNU
egrep to MS-DOS. I don't have the sources or my diffs on-line
so this is a touch vague. The basic problem was that once the
initial small (16k?) buffer was outgrown, a call to realloc is
made with size set by (1 << 16) which is 64k, but guess what
happens on MS-DOS with its 16bit int's? Yep, realloc is called
with a size of 0, causing everyone to think that there is no
memory left.
I can't recall whether I made it (1 << 15) or ((1 << 16) - 1)
(if being compiled on MSDOS) anyway that made the problem
dissappear.
Look for calls to {m,re,xm,xre}alloc and check the sizes being
used keeping in mind that you only have 16bits.
--
Simon J. Gerraty <sjg@zen.void.oz.au>
#include <disclaimer> /* imagine something _very_ witty here */
Technical Details
Message-ID:
<1992Sep15.102436.23317@zen.void.oz.au>Path:
arc1-ca.pugleaf.net!sparky!uunet!europa.asd.contel.com!darwin.sura.net!zaphod.mps.ohio-state.edu!sdd.hp.com!uakari.primate.wisc.edu!usenet.coe.montana.edu!mintaka.lcs.mit.edu!ai-lab!prep.ai.mit.edu!gnulistsReferences:
<87kn3yb.westes@netcom.com> <1992Sep3.155835.10175@midway.uchicago.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!europa.asd.contel.com!darwin.sura.net!zaphod.mps.ohio-state.edu!sdd.hp.com!uakari.primate.wisc.edu!usenet.coe.montana.edu!mintaka.lcs.mit.edu!ai-lab!prep.ai.mit.edu!gnulists From: sjg@zen.void.oz.au (Simon J. Gerraty) Newsgroups: gnu.utils.bug,comp.os.msdos.programmer Subject: Re: MS-DOS Version of diff Exhausts Memory Message-ID: <1992Sep15.102436.23317@zen.void.oz.au> Date: 15 Sep 92 10:24:36 GMT References: <87kn3yb.westes@netcom.com> <1992Sep3.155835.10175@midway.uchicago.edu> Followup-To: gnu.utils.bug,comp.os.msdos.programmer Organization: zen programming... Lines: 32 Approved: info-gnu@prep.ai.mit.edu Apparently-To: bug-gnu-utils@prep.ai.mit.edu