chiark / gitweb /
util: add alloca_align()
authorDavid Herrmann <dh.herrmann@gmail.com>
Mon, 22 Sep 2014 10:05:16 +0000 (12:05 +0200)
committerDavid Herrmann <dh.herrmann@gmail.com>
Mon, 22 Sep 2014 12:27:02 +0000 (14:27 +0200)
commit95d78c7e7c81a6b788f28c33ef2cafd87471a0d7
tree165ff83c1a3c42ca003e15d1211062254dd830c8
parenteee846339d2f76f568c62b3725bf75bcee728115
util: add alloca_align()

The alloca_align() helper is the alloca() equivalent of posix_memalign().
As there is no such function provided by glibc, we simply account for
additional memory and return a pointer offset into the allocated memory to
grant the alignment.

Furthermore, alloca0_align() is added, which simply clears the allocated
memory.
src/shared/util.h
src/test/test-util.c