Commit Graph

12 Commits

Author SHA1 Message Date
Christophe Fergeau
ea9e91cd8d mingw: don't try to redefine alloca
mingw already has a #define alloca __builtin_alloca so trying to
redefine it triggers a warning.
2012-03-20 15:25:56 +01:00
Marc-André Lureau
3349946ab2 common: mem.h add alloca definition
We don't support the autoconf ALLOCA/C_ALLOC fallback. If one day,
someone cares for a weird platform, he can fix it.
2012-03-20 15:25:52 +01:00
Christophe Fergeau
c15c5050af common: add extern "C" guards to headers
Since some spice C++ code is using code from common/, the C
functions need to be marked as such for the C++ compiler, otherwise
we'll get linkage issues.
2012-03-20 15:25:51 +01:00
Marc-André Lureau
99a225c87a common: add SpiceBuffer - based on qemu-vnc Buffer
https://bugs.freedesktop.org/show_bug.cgi?id=34795
2012-03-20 15:25:51 +01:00
Alexander Larsson
69c1444add Move SpiceChunks to mem.h 2012-03-20 15:25:48 +01:00
Alexander Larsson
c471990a9f Move in spice/draw.h from spice-protocol to common/ 2012-03-20 15:25:48 +01:00
Alexander Larsson
8f568a4073 Add spice_chunks_* helpers 2012-03-20 15:25:47 +01:00
Alexander Larsson
d4361e12d0 Add spice_strnlen 2012-03-20 15:25:43 +01:00
Alexander Larsson
41171d081d Fix spelling errors in comments and strings 2012-03-20 15:25:42 +01:00
Alexander Larsson
92e30df45c Relicense everything from GPL to LGPL 2.1+ 2012-03-20 15:25:41 +01:00
Alexander Larsson
998bf873bf Add spice_strndup
Also, make str(n)dup handle NULL correctly
2012-03-20 15:25:40 +01:00
Alexander Larsson
59b330b4d2 New memory allocators that exit on OOM and handle multiplication overflow
Every place that does a regular malloc/calloc and aborts on failure
should use spice_malloc/spice_mallo0 instead, which is leaner and cleaner.

Allocations of dynamically sized arrays can use g_malloc_n or g_new etc
which correctly handle multiplication overflow if some of the arguments
are not trusted.
2012-03-20 15:25:40 +01:00