corinthia-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dennis E. Hamilton" <dennis.hamil...@acm.org>
Subject RE: Checking malloc success and adding perror()
Date Thu, 19 Feb 2015 12:06:04 GMT
+1 about a cheap check and common abort procedure for starters.

I think figuring out what to do about cleanup and exception unwinding, and even what exception
handling to use (if any) is a further platform-development issue that could be masked with
simple still-inlineable code, but needs much more architectural thought.

-----Original Message-----
From: jan i [mailto:jani@apache.org] 
Sent: Thursday, February 19, 2015 03:15
To: dev@corinthia.incubator.apache.org
Subject: Re: Checking malloc success and adding perror()

[ ... ]
I do agree that we should avoid exploding the code, however there are
elegant solutions to that.

I am a strong believer in "believe is good, control is better", meaning
donĀ“t trust such functions. Corinthia also works on small devices, and just
think of someone opening a big complicated document on a smartphone...that
is nearly bound to cause memory problems.

Having the checks in code, makes us search for the problems in the right
place....e.g. returning a NULL pointer might cause a crash in a very
different place.

[ ... ]


Mime
View raw message