Return-Path: <tiff-bounces@lists.maptools.org>
Received: from inas006.isp.belgacom.be (localhost [127.0.0.1])
        by inav005.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-AV-3.00) with ESMTP id j9QIAYRf015658
        for <joris.at.lebbeke@skynet.be>; Wed, 26 Oct 2005 20:10:36 +0200
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from inmx001.isp.belgacom.be (inmx001.isp.belgacom.be [195.238.5.1])
        by inas006.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-AS-2.03) with ESMTP id j9QIAVXG003683
        for <joris.at.lebbeke@skynet.be>; Wed, 26 Oct 2005 20:10:33 +0200
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from duke.maptools.org (r153.dmsolutions.ca [209.217.116.153] (may be forged))
        by inmx001.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-2.32) with ESMTP id j9QIARNE029354
        for <joris.at.lebbeke@skynet.be>; Wed, 26 Oct 2005 20:10:27 +0200
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from duke.maptools.org (duke.maptools.org [127.0.0.1])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id j9QI5M3T017606;
	Wed, 26 Oct 2005 14:05:33 -0400
Received: from scooby.simplesystems.org (scooby.simplesystems.org
	[65.66.246.67])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id j9QI5IGl017587
	for <tiff@lists.maptools.org>; Wed, 26 Oct 2005 14:05:18 -0400
Received: from blade.simplesystems.org (blade.simplesystems.org [65.66.246.74])
	by scooby.simplesystems.org (8.12.10+Sun/8.12.10) with ESMTP id
	j9QI5H8a012493; Wed, 26 Oct 2005 13:05:17 -0500 (CDT)
Date: Wed, 26 Oct 2005 13:05:17 -0500 (CDT)
From: Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
X-X-Sender: bfriesen@blade.simplesystems.org
To: ryuki_dono <ryuki_dono@yahoo.de>
Subject: Re: [Tiff] Re: checking test images
In-Reply-To: <435FC119.1090307@yahoo.de>
Message-ID: <Pine.SOC.4.60.0510261257030.7597@blade.simplesystems.org>
References: <435A42F0.8010106@yahoo.de> <435E1641.3010900@yahoo.de> 
	<Pine.SOC.4.60.0510250926310.7597@blade.simplesystems.org>
	<435F713C.20901@yahoo.de>
	<931f8ea90510260743h4ff11958kfacf60ead3c59ce5@mail.gmail.com>
	<435FC119.1090307@yahoo.de>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: tiff@lists.maptools.org
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.4
Precedence: list
List-Id: TIFF and libtiff discussion <tiff.lists.maptools.org>
List-Unsubscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=unsubscribe>
List-Archive: <http://lists.maptools.org/mailman/private/tiff>
List-Post: <mailto:tiff@lists.maptools.org>
List-Help: <mailto:tiff-request@lists.maptools.org?subject=help>
List-Subscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=subscribe>
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org
X-UIDL: 000000000023ceae.00000dab
X-MSP-STORE: Wed, 26 Oct 2005 20:10:43 +0200
Status:   

On Wed, 26 Oct 2005, ryuki_dono wrote:
>
> The thing with the errormanager... There isn't much help with it in the man 
> pages. I tried to find help with the provided
> sources of tools. I tried to  compare  it with jpeg.lib and png.lib that use 
> a similar system. Jpeg.lib uses longjump and a
> jumpbuffer to jump from the errorhandler function to a block of instruction. 
> Png.lib uses exceptions and/or longjumps
> in the same manner. Since both keep track of allocated memory and provide 
> "abort and cleanup" functions it is save (?)
> that way. I only used the png approach with try and catch.
> Thank you for your notes. I will try and see if I can cleanup my code some 
> more.

The libjpeg and libpng approach is definitely not "safe".  It requires 
that the library and library user take great care in order to make 
sure that memory is not leaked.  Use of setjmp/longjmp is not trivial 
by any means and they are not assured to be thread safe. 
Setjmp/longjmp are based on platform/CPU specific implementations 
which play tricks with the stack and CPU registers.

For C language, I definitely prefer synchronous error handling rather 
than asynchronous.  C++ is another matter entirely since the language 
provides what is needed to ensure that allocated data can be safely 
destroyed in exception-safe code.

Bob

_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
