bug-gnulib
[Top][All Lists]
Advanced

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

Re: LGPLv3 for xalloc?


From: Eric Blake
Subject: Re: LGPLv3 for xalloc?
Date: Thu, 21 Feb 2013 08:43:49 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2

On 02/21/2013 02:11 AM, Christian Egli wrote:
> Hi all
> 
> I would like to use xalloc in liblouis[1] a library (and a couple of
> programs) for braille transcription. The main author just sprinkled the
> library code with stuff like
> 
> foo = malloc(FOO_SIZE);
> if (!foo)
>    outOfMemory();
> 
> I would like to replace this with xmalloc. However it appears that
> xalloc is GPL. Would it be possible to relicense this under LGPLv3?

The point of xalloc is generally to exit on error; but libraries should
never exit.  The choice of GPL is intentional, to discourage libraries
from using an interface that is not appropriate in library design.  You
really ought to be fixing liblouis so that it returns a clean error
indication to the user, instead of aborting their program.

I suppose that you could provide your own alternative xalloc_die() that
doesn't die, but merely longjmp()s out of your allocation attempt and
back to the entry point of your library; at which point xalloc() calling
into your xalloc_die() might be able to be made library-safe; but it
just feels like a lot of work, especially if your outOfMemory() call
already in your code can do the same longjmp unwinding without using xalloc.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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