Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site rtech.ARPA Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!ihnp4!zehntel!dual!unisoft!mtxinu!rtech!mark From: mark@rtech.ARPA (Mark Wittenberg) Newsgroups: net.lang.c Subject: Re: event-handling approach to errors Message-ID: <222@rtech.ARPA> Date: Sat, 9-Mar-85 07:35:06 EST Article-I.D.: rtech.222 Posted: Sat Mar 9 07:35:06 1985 Date-Received: Mon, 11-Mar-85 07:19:44 EST References: <7028@watdaisy.UUCP> <105@mit-athena.UUCP> Organization: Relational Technology, Berkeley CA Lines: 21 > It would be really nice if you > could intercept the out-of-bounds reference, determine that it was for > one of the select list of "growable" arrays, and re-allocate the one > involved to have more space. > > John Chambers Of course this is essentially what the early "ed" editor did (does); for all I know its derivatives do too: when its array of line pointers ran out of space it did a "free(); realloc()" to "grow" (copying only if needed) the array. I don't know how portable this use of realloc is though. To be clear, ed doesn't "intercept the out-of-bounds reference"; it detects when it's run out of space without generating an error. I know it's not quite the same thing, but this is the only common UN*X program that I know of which does this "free & realloc" trick; anybody else know of others? -- Mark Wittenberg Relational Technology zehntel!rtech!mark ucbvax!mtxinu!rtech!mark