Is "Out of Memory" a recoverable error?

Leandro Lucarella llucax at gmail.com
Thu Dec 4 08:37:29 PST 2008


Robert Jacques, el  3 de diciembre a las 09:39 me escribiste:
> That's a good point/use case. However,
> 1) Many client-sever applications seperate each client into a logical thread of 
> some kind. And inside this thread, out of memory is not recoverable.

Unfortunatelly not all designs are multithread. In my for example, we work
with a single thread event loop.

> 2) One can still catch an error if need be.

I don't know what do you mean by that. If you mean you could use
a try/catch block, that's no true if allocation can't throw (to be able
to allocate in nothrow functions).

If you mean you can use an allocation function that don't throw but report
the failure in other way (like returning a null pointer), yes, as I said
one, could always use that function, but is a PITA (specially for string
manipulation, hashes and dynamic arrays).

-- 
Leandro Lucarella (luca) | Blog colectivo: http://www.mazziblog.com.ar/blog/
----------------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------------
La terapia no sirve: es mucho mejor pagar para hacer las perversiones
que para contarlas.
	-- Alberto Giordano (filósofo estilista)



More information about the Digitalmars-d mailing list