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
signature.asc
Description: OpenPGP digital signature