Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!elroy.jpl.nasa.gov!decwrl!pa.dec.com!src.dec.com!src.dec.com!muller From: muller@src.dec.com (Eric Muller) Newsgroups: comp.lang.modula3 Subject: Re: running out of memory Message-ID: <1991Feb11.180750.4914@src.dec.com> Date: 12 Feb 91 02:07:50 GMT References: <9102120059.AA15796@jumbo.pa.dec.com> Sender: news@src.dec.com (News) Reply-To: muller@src.dec.com (Eric Muller) Organization: DEC Systems Research Center Lines: 38 In article <9102120059.AA15796@jumbo.pa.dec.com>, gnelson (Greg Nelson) writes: > Of course, as Dave Emery points out, has to be coded very > carefully (for example, it must not allocate any storage). In fact, > Wr.PrintText might allocate storage, so the TRY-EXCEPT-ELSE code above > is useless as it stands. But we can imagine providing a very robust > library procedure that prints a TEXT on Stdio.stderr without allocating > any storage or depending on anything except the very lowest levels > of the runtime system, and use it instead of Wr.PrintText. The SmallIO interface in the core library will provide that functionality in SRC Modula-3 1.6. > The design of this interface is quite system-dependent, > as these examples suggest, but it should not be difficult to provide > a single interface that works in, say, all standard Unix environments. > SRC Modula-3 does not yet provide such an interface, but Eric Muller > tells me that one is on the way. New in RTMisc.i3: TYPE Exitor <: REFANY; PROCEDURE RegisterExitor (p: PROCEDURE (n: INTEGER)): Exitor; (* Registers the procedure p to be executed when Exit is called or when a checked runtime error is dectected; it is passed the argument of Exit, -1 for checked runtime errors. The registered procedures are executed in the reverse order of registration. *) PROCEDURE UnregisterExitor (e: Exitor); (* removes e's procedure from the registered set. *) PROCEDURE Exit (n: INTEGER); (* call the registered exitors and terminate the program with status 'n' *) -- Eric.