Generic dynamic array implementation in C
See
this Stackoverflow answer for
a discussion on the optimal growth factor for dynamic
arrays. The gist of it is that it depends, but growth
factors around the golden ratio are easier for the memory allocator to
handle. I'd recommend using 1.5 because it is easy to implement:

DEST-&gt;cap += DEST-&gt;cap / 2


It likely fares worse on artifical benchmarks but better on real
workloads. This requires that the minimum capacity of the dynamic
array is 2 which is reasonable. But a more realistic minimum size
likely should be 8 or 16 since
the minimum malloc size is 32
bytes.

In aAppend you are always realloc:ing which will cause performance
to suffer if many small dynamic arrays are collected into one big one
in a loop. Instead, you want something like:

size_t req = DEST-&gt;size + X-&gt;size;
if (req &gt; DEST-&gt;cap) {
    aResize(DEST);
}
memcpy(DEST-&gt;data + DEST-&gt;size, X-&gt;data, X-&gt;size * X-&gt;typeSize);
DEST-&gt;size = req;


The last thing I'd change is the alignment of the capacity to a power
of two in aInit. On realistic workloads, a good chunk of all
variable arrays never grow so the alignment just wastes space. But
if you insist on alignment, this function is better than the loop:

static inline int
next_pow2(int v) {
    v--;
    v |= v &gt;&gt; 1;
    v |= v &gt;&gt; 2;
    v |= v &gt;&gt; 4;
    v |= v &gt;&gt; 8;
    v |= v &gt;&gt; 16;
    v++;
    return v;
}


I also wonder why you are using macros when C99 has inline functions?
They have many advantages in comparison to code macros.