Add support for user provided memory.