Merge "Add support for user-allocated buffers from the C++ API."