Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!spool.mu.edu!uunet!wuarchive!udel!ee.udel.edu From: new@ee.udel.edu (Darren New) Newsgroups: comp.lang.modula3 Subject: Re: NEW out of memory Message-ID: <45138@nigel.ee.udel.edu> Date: 19 Feb 91 20:10:41 GMT Sender: usenet@ee.udel.edu Organization: University of Delaware Lines: 27 Nntp-Posting-Host: estelle.ee.udel.edu I tried to mail this, but it bounced. => EXCEPTION NOMEM(size : INTEGER); => Size is the number of kilobytes in the request that caused => the failure. => => Huh? Why kilobytes? Suppose I run out of memory requesting 10 bytes. => That's closer to 0K than 1K--it's conceptually unclean to run out of => memory when requesting none of it. Is there some sort of good reason => for this unnecessary factor of 1000? Well, I was thinking that integers may not be big enough to hold an address. That is, you could have more addressable units than integers, making large allocations difficult to describe. (I believe I saw something like this in libraries somewhere, where the base-2 log of a size was used instead of the actual size.) Naturally, the request would be rounded up to the next 1024 unit. The intention of giving the size was to allow the program freeing memory to only free what was needed by somebody else. For example, a disk cache could only flush and free 20 buffers instead of all 600. Freeing too much would not be a problem. (Nor would freeing too little in my scheme, due to the retries.) -- Darren -- --- Darren New --- Grad Student --- CIS --- Univ. of Delaware --- ----- Network Protocols, Graphics, Programming Languages, Formal Description Techniques (esp. Estelle), Coffee, Amigas ----- =+=+=+ Let GROPE be an N-tuple where ... +=+=+=