[sword-devel] Re: Error Handling

Troy A. Griffitts scribe at crosswire.org
Fri Jun 10 19:34:05 MST 2005


Robin,
	There a number of issues involved with considering moving to 
try/throw/catch error handling.  The first one that comes to mind is 
language binding.  Second is cross-platform portability with OSs like 
PocketPC, which, if I remember correctly don't have compilers that 
support exceptions or RTTI.  I'm not in a mental state to debate the 
merits of either system for a few months, but we have a long running 
list of improvements to the engine.  If it is something you have a 
practicle reason for desiring, please open a new feature request and 
include justification and we'll not forget to address the issue 
(actually this goes out to anyone who wishes to switch error handling 
models).

	-Troy.

PS.  I think we've done a pretty solid job to keep memory usage down to 
a minimum.  I'm not sure that any of our apps are running out of memory 
doing anything these days.  We run on some small platforms, like PDAs 
with as little as a total of 16MB of RAM.  The optimizations to make us 
work in these environments have left us with a fairly lean memory 
footprint, even on larger systems.  Most of our objects which allocate 
and cache resources implement an SWCacher interface with 
resourceConsumption and lastAccess reporting, and a flush method to ask 
them to clean up.  We where planning on writing a CacheMgr which all 
these SWCacher object could be handed to, that would monitor these 
objects and keep total resourceConsumption within a reasonable 
tolerance, but haven't done so yet.  That was a long PS.



RLRANDALLX at aol.com wrote:
> In a message dated 6/10/2005 12:03:57 P.M. Pacific Daylight Time, 
> sword-devel-request at crosswire.org writes:
> 
> 
>     Hey Daniel,
>         Thanks for the catch, but we don't check for successful memory
>     allocation anywhere in the engine.  I'm not sure what we'd do if we ran
>     out of memory.  Gracefully degradating from such a state is a complex
>     problem.  Also, our engine doesn't use try/catch/throw error handling,
>     so throwing anything would cross a consistency line.  Note: not
>     debating
>     that we SHOULDN'T use exception error handling, only that we currently
>     do not
> 
> Troy,
>  
> Wearing my QA hat, I think we ought to plan on using try/catch/throw 
> error handling pretty soon.  How about after your sabbatical?:) Also can 
> we set some standard for garbage collection?  For example when we 
> construct a temporary object is the deconstructor working properly to 
> clean things up? I'm not a C++ programmer, so maybe you have some better 
> ideas to help keep us from running out of memory.
>  
> In His Grace,
> Robin
>  
> E-mail: RLRandallX at aol.com
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page



More information about the sword-devel mailing list