This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Dynamic growable arrays for internal use


On 06/01/2017 09:13 AM, Carlos O'Donell wrote:
http://git.savannah.gnu.org/cgit/gnulib.git/tree/lib/xalloc.h http://git.savannah.gnu.org/cgit/gnulib.git/tree/lib/xmalloc.c
Before I look...

What license do these files have?

They're GPLed, with copyright assigned to the FSF. Although we haven't run into a need for an LGPLed version, that would not be hard to arrange, so I wouldn't worry about the LGPL-vs-GPL licensing issues.

One other thing: I'm implementing a slightly different version for Gnulib that uses ptrdiff_t rather than size_t for sizes (and is LGPL rather than GPL since it will clearly have uses in library situations). Using ptrdiff_t improves reliability, since one can compile with -fsanitize=undefined to catch integer overflow with size calculations. Over the years we have found that using size_t for byte and object counts leads to problems for which there is no effective automated checking. This is why I suggest that new memory-allocation APIs use ptrdiff_t rather than size_t.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]