[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Devel] Paper: Cleanup Stack Exception Handling

From: Sander van der Wal
Subject: Re: [Devel] Paper: Cleanup Stack Exception Handling
Date: Mon, 3 Sep 2001 10:17:10 +0200

----- Original Message -----
From: "David Turner" <address@hidden>
To: <address@hidden>
Sent: Friday, August 31, 2001 12:42 PM
Subject: [Devel] Paper: Cleanup Stack Exception Handling

> Hello to all members of the FreeType devel list,
>   I'd like to collect your opinion on a paper I just finished. It's
>   now available as HTML at:
>   Note that the paper is not MLib specific, and should be an
>   read to _any_ C developer that wants to write reliable code
>   (i.e. without checking everything everywhere), so don't skip it if
>   you don't care about the MLib/FTLayout stuff..

As an EPOC developer for about two years I can vouch for the cleanup
approach. It is easy to use, at least not harder to use than exception
handling and auto_ptr protected local variables. Epoc runs on machines
with as little as 4 Mb of memory (the Oregon Scientific Osaris), with
8 (Revo) and 16 Mb (5Mx, Revo Plus) machines being the most popular.
Not leaking memory is vital for programs on these devices.

Some other comments:

Could you add to c_bench.c a fully error-checked case, as that should
give a better idea how much the different protection schemes cost in
both time and code space.

This scheme only protects agains memory leaks due to memory allocation
failure, or other THROW()'n exceptions. It doens't protect against
memory leaks due to programming errors, like forgetting to push. In
EPOC, the combination of a cleanup stack and automatic checking
whether all allocated blocks of memory are also released at program
closedown, is what makes programs much more reliable.

Sander van der Wal

reply via email to

[Prev in Thread] Current Thread [Next in Thread]