hide C memory allocation quirks

The usage of the C standard library for dynamic memory allocation is an
implementation detail and will not always be the underlying allocator.